PING  0.9
Statistical data handling and processing in production environment
list_difference

Calculate the (asymmetric) difference between two unformatted lists of char.

%let diff=%list_difference(list1, list2, casense=no, sep=%quote( ));

Arguments

  • list1, list2 : two lists of unformatted strings;
  • casense : (option) boolean flag (yes/no) set to perform cases sensitive search/matching; default: casense=no, i.e. the upper-case elements in both lists need to differ;
  • sep : (option) character/string used as a separator in the input lists; default: sep=%quote( ), i.e. the input list1 and list2 are both blank-separated lists of items.

Returns

diff : output concatenated list of characters, namely the list of strings obtained as the asymmetric difference: list1 - list2.

Examples

%let list1=A B C D E F;
%let list2=A B C;
%let diff=%list_difference(&list1, &list2);

returns: diff=D E F, while:

%let diff=%list_difference(&list2, &list1);

returns: diff=.

Run macro %_example_list_difference for more examples.

Notes

  1. This is a setwise operation to be understood as list1 \ list2.
  2. Items are matched exactly since the macro FINDW is used.

See also

%list_intersection, %clist_difference, %list_compare, %list_append, %list_find, FINDW.