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 (March 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 4 Mar 2008 15:48:08 +0000
Reply-To:   toby dunn <tobydunn@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   toby dunn <tobydunn@HOTMAIL.COM>
Subject:   Re: Test if Macro variable contains String
Comments:   To: Will <schimpanski@gmx.de>
In-Reply-To:   <6358d7F24t9unU1@mid.individual.net>
Content-Type:   text/plain; charset="iso-8859-1"

Will , To answer your question it depends on how crazy your pattern you are trying to match is: Simple match : %IndexSimple Match where you need a modifier: %SysFunc( FindC( , , , ) ) Complex Matches use PRXMatch %if ( %SysFunc( Find( &pstatmod , GLMM , i ) ) Ge 1 ) %then %do; Notice that I droppped the single quotes, well they have meaning in the macro facility just like they do in the data step just not the same meaning. In the Data Step they tell SAS what not to interprete as having meaning in the macro facility they are part of the value. Toby Dunn "Don't bail. The best gold is at the bottom of barrels of crap." Randy Pausch "Be prepared. Luck is where preparation meets opportunity." Randy Pausch> Date: Tue, 4 Mar 2008 16:32:55 +0100> From: schimpanski@GMX.DE> Subject: Test if Macro variable contains String> To: SAS-L@LISTSERV.UGA.EDU> > Dear all,> > how can I test in a macro %if-%then statement whether a macro variable> contains a certain string?> > My try (does not work):> ----------------------> > %let pstatmod = 'schubiduGLMMschubidu';> > %mymacro ();> > %if find(&pstatmod,'GLMM','i') ge 1 %then %do;> proc glimmix data = pstaged.stage_v1 method=rmpl;> class &classvariables;> model &criterion (event='1') = &predictor /dist=binary link=logit;> random tvab /subject=pairid group=bestzyg_r1 type=chol residual;> run;> %end;> > %mend mymacro;> > Thanks in advance,> > Will _________________________________________________________________ Need to know the score, the latest news, or you need your HotmailŪ-get your "fix". http://www.msnmobilefix.com/Default.aspx


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