Date: Thu, 10 Mar 2011 10:23:30 -0800
Reply-To: "Sprague, Webb (OFM)" <Webb.Sprague@OFM.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Sprague, Webb (OFM)" <Webb.Sprague@OFM.WA.GOV>
Subject: Re: "Unpacking" variable in a datastep into a "macro function"
In-Reply-To: <201103101820.p2ABna63009455@willow.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Thanks ! ...
> %macro type(txt);
> %let txt=(upcase(compress(&txt," ","psc")));
> (ifc(prxmatch("/RE*MO*DE*L/",&txt),"REMODEL","BUILDNEW"))
> %mend type;
What if you have a bunch of regex'es you want to match? The sample I
gave only had the two alternatives, but really I have one for REMODEL,
SINGLE FAMILY, MULTI, DUPLEX, etc.
|