%IF (&Variable NOT IN (Apples Oranges)) %THEN %DO;
can try this, for you to use not in in macro , you have to use the %eval; but you can create a call symputx that will store the values apple and oranges , eg. lets say the macro variable with the name apple,oranges is fruits, so the macro &fruits will resolve to apple and oranges. so i will have the following code
also remember to put the options statement at the top of the macro;
options minioperator mindelimiter=",";
like this
%if not %eval (%upcase(&fruits) in APPLES,ORANGES) %then %do;
> I was wondering is it possible to use "Not IN" in a conditional statement using the macro facility.
Yes it is. Look at the minoperator and mindelimiter options.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.