Hi:
As you can see, the IN is valid in an IF statement and in a WHERE statement in a DATA step program. Before you use macro variables, it is useful to have a -working- program to start with, so you know the correct syntax needed. (But note that my IN condition does NOT use quoted strings because AGE is a numeric variable. It would be WRONG to use IN with quoted strings for a numeric variable. And your originally posted code showed quotes around your macro variable -- which was an incorrect usage of IN -- since the IN conditions go inside parentheses.)
cynthia
[pre]
977 data one;
978 set sashelp.class;
979 if age in (11, 12, 13) then output;
980 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.ONE has 10 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.01 seconds
981
982 data two;
983 set sashelp.class;
984 where age in (11, 12, 13);
985 run;
NOTE: There were 10 observations read from the data set SASHELP.CLASS.
WHERE age in (11, 12, 13);
NOTE: The data set WORK.TWO has 10 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
986
987 data three four five;
988 set sashelp.class;
989 if age in (11, 12, 13) then output three;
990 else if age in (14, 15) then output four;
991 else output five;
992 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.THREE has 10 observations and 5 variables.
NOTE: The data set WORK.FOUR has 8 observations and 5 variables.
NOTE: The data set WORK.FIVE has 1 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.04 seconds
[/pre]