%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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.