So this might be a simple and basic question, but I can't find an answer from searching online
if Var1 in (1 2 3) then var2=1;
so in the code above the IN is include. But is there one that is "not include"? Typically I would not use this on a if statement, but more of a where statement when running a proc freq for example. I know I can do Var1 NE 0 AND VAR1 NE 4 for example, but wondering if there is a way to list it like I did above
Hi,
Have you tried:
data _null_;
var1=5;
if var1 not in (1 2 3) then var2=1;
put var2=;
run;
Regards,
Amir.
Hi,
Have you tried:
data _null_;
var1=5;
if var1 not in (1 2 3) then var2=1;
put var2=;
run;
Regards,
Amir.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.