|
On Thu, 10 Mar 2011 09:17:06 -0800, Sprague, Webb (OFM)
<Webb.Sprague@OFM.WA.GOV> wrote:
...
>I imagine it is a problem with (un)quoting and sysfunc and prxmatch, but
>I am baffled and would appreciate any advice I can get...
...
hi, Webb,
here is one way. This is sometimes called as a function-style macro, since
it can be "called" as if it were a function. under the hood, however, the
macro resolves into an expression to be compiled and executed as a part of
a statement.
cheers,
chang
%macro type(txt);
%let txt=(upcase(compress(&txt," ","psc")));
(ifc(prxmatch("/RE*MO*DE*L/",&txt),"REMODEL","BUILDNEW"))
%mend type;
/* check */
data _null_;
do var = "remodel", "model";
type = %type(var);
put var= type=;
end;
run;
/* on log
var=remodel type=REMODEL
var=model type=BUILDNEW
*/
|