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 (October 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 21 Oct 2010 14:10:30 -0500
Reply-To:   Yu Zhang <zhangyu05@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Yu Zhang <zhangyu05@GMAIL.COM>
Subject:   Macro quoting help
Content-Type:   text/plain; charset=ISO-8859-1

Hi,

I want to pass a name to the macro. the macro fails to run when there is an apostrophe in the name. for example,Jame's. the parameters that need to pass to the macro are stored in a SAS dataset. Call execute routine will be used to generate the Macro call.

for some reason, I need to delay the macro execution. here is my code. it seems it is not possible to accomplish what I want. if the %nrstr was not used, the code will run with no problem. However, I really want to the delay the macro execution. what I would like to see in the log are

Note: Call execute generated line. +%summary (xxxx)

execution of the macro

Note: Call execute generated line. +%summary(yyyy) execution of the macro

Note: Call execute generated line. +%summary(zzzz) .......

Warning: the code might crash your machine, please run it in a new SAS session.

Can someone help?

Thanks!

Yu

data event_id; hospital_name="some name's Hospital"; output; run;

%macro summary(hospital_name); data test; name="&Hospital_name"; output; run; %mend;

data _null_; set event_id; str='%nrstr(%summary(%bquote('||hospital_name||')))'; <-------------need some help?? call execute (Str); run;


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