LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2012, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 12 Mar 2012 18:21:43 -0400
Reply-To:     Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject:      Re: Is a variable name present in a list of variable names stored
              in a macro variable? XXXX

Use INDEXW function.

%IF %sysfunc(indexw(%UPCASE(&E),%UPCASE(&VAR1))) %THEN %LET PRESENT = YES;

Better still the result to present and then you can use the numeric value in future logic.

%let present=%sysfunc(indexw(%upcase(&e),%upcase(&var1))); %if &present %then %do; ... %end;

On Mon, 12 Mar 2012 16:03:03 -0400, Dan Abner <dan.abner99@GMAIL.COM> wrote:

>Hi everyone, >%IF %INDEX(%UPCASE(&E),%STR( %UPCASE(&VAR1) )) %THEN %LET PRESENT = YES;


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