Date: Thu, 11 Aug 2005 16:44:47 -0700
Reply-To: monal kohli <k_monal_99@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: monal kohli <k_monal_99@YAHOO.COM>
Subject: Re: comparison of quoted macro strings
In-Reply-To: <200508112322.j7BNMEd4011329@listserv.cc.uga.edu>
Content-Type: text/plain; charset=iso-8859-1
Try this
%matcher(%str(john%'s test), john);
MK
--- saslist <saslist@COMCAST.NET> wrote:
> I'm having some trouble attempting to compare macro
> string with masked
> characters. Below is a greatly simplified example.
>
> options symbolgen mprint;
> %macro matcher(var1,var2);
> data _null_;
> %LET X = %INDEX(&var1, &var2);
>
> %IF &X > 0 %then %do;
> PROC SQL;
> INSERT INTO WORK.MATCHES (var1,var2) VALUES
> ("&var1",
> "&var2")
> ;
> QUIT;
> %end;
> run;
> %mend matcher;
> %matcher(%NRBQUOTE(john's test, john));
>
> This does not set X to anything but 0. If I delete
> the "'" and the %
> NRBQUOTE, then it works fine however the text I'm
> dealing with has quotes
> and apostophes. How do I mask these characters and
> get the macro facility
> to make the comparison. TIA.
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|