PING  0.9
Statistical data handling and processing in production environment
clist_difference

Calculate the (asymmetric) difference between two parentheses-enclosed, comma-separated and/or quote-enhanced lists of char.

%let diff=%clist_difference(clist1, clist2, casense=no, mark=%str(%"), sep=%quote(,));

Arguments

  • clist1, clist2 : two lists of formatted (e.g., parentheses-enclosed, comma-separated quote-enhanced) 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;
  • mark, sep : (option) characters/strings used respectively as a "quote" and a separator in the input lists; default: mark=str(%"), and" sep=%quote(,), i.e. clist1 and clist2 are both comma-separated lists of quote-enhanced items; see %clist_unquote for further details.

Returns

diff : output concatenated list of characters, namely the list of (comma-separated) strings in between quotes obtained as the asymmetric difference: clist1 - clist2.

Examples

%let clist1=("A","B","C","D","E","F");
%let clist2=("A","B","C");
%let diff=%clist_difference(&clist1, &clist2);

returns: diff=("D","E","F"), while:

%let diff=%clist_difference(&clist2, &clist1);

returns: diff=().

Run macro %_example_clist_difference for more examples.

Note

The macro will not return exactly what you want if the symbol $ appears somewhere in the list. If you need to use $, you can reset the global macro variable G_PING_UNLIKELY_CHAR (see _setup_ file) to another dumb (unlikely) character of your own.

See also

%list_difference, %clist_compare, %clist_append, %clist_unquote, %list_quote.