%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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.