Date: Fri, 15 Jan 2010 09:46:03 -0500
Reply-To: sas biology <sasbio@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: sas biology <sasbio@GMAIL.COM>
Subject: 'IN' in macros
Content-Type: text/plain; charset=ISO-8859-1
Hello All,
How can I do this using Macros?
if a *in* (1 2 3) then b=a;
else b=a=1;
I can think of doing it in macros this way:
%if *&a=1 or &a=2 or &a=3* %then %do;
b=&a;
%end;
%else %do;
b=%eval(&a+1);
%end;
I am sure there must be a better way of doing it. Can someone spend some
time on this?
I specifically want to know how to avoid using 'OR' as in *&a=1 or &a=2 or
&a=3* and how to do it in a simple way.
**
Thanks
SB