I was surprised to find out that the IN operator is not supported variable names.
If things change, just let me know
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/p1n8bsqqd03xppn17pgvjpjlbhhs.htm#n0bcs3v4p8klexn1p2uvo1z9pg4s
data demo;
x=1;
run;
data demo1;
set demo;
if x in (1,2) then flag=1;
run;
data demo2;
set demo;
y=1;
if x = y or x =2 then flag=1;
run;
data demo3;
set demo;
y=1;
if x in (y,2) then flag=1;
run;
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant,
a missing value, iterator, (.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
... View more