SAS v9.2 introduces macro option mindelimiter. This option simplifies the IN operation in a macro environment. Here is an example to illustrate the usage of the option.
options minoperator;
%macro test(value)/mindelimiter=',';
%if &value in 1,2,3,4,5,6 %then %put Value found within list.;
%else %put Value not in list.;
%mend;
%test(3)
%test(8)
*******************************;
30 options minoperator;
31 %macro test(value)/mindelimiter=',';
32
33 %if &value in 1,2,3,4,5,6 %then %put Value found within list.;
34 %else %put Value not in list.;
35
36 %mend;
37
38 %test(3)
Value found within list.
39 %test(8)
Value not in list.