LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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


Back to: Top of message | Previous page | Main SAS-L page