LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 5 Mar 2004 17:39:18 -0500
Reply-To:     "Farrer, Andrew C" <Andrew.Farrer@CIBC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Farrer, Andrew C" <Andrew.Farrer@CIBC.COM>
Subject:      Re: Macro Quoting Problem
Comments: To: Kevin Myers <KevinMyers@AUSTIN.RR.COM>
Content-Type: text/plain

I am no expert either but using %nrstr seems ok:

%macro testit(arg1); %put &arg1; %mend testit;

%testit(%nrstr(a&b)) ;

-----Original Message----- From: Kevin Myers [mailto:KevinMyers@AUSTIN.RR.COM] Sent: Friday, March 05, 2004 5:03 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Macro Quoting Problem

Most of the time I think that I know the SAS macro language pretty well. But then along comes some simple problem like the following to knock my ego back down to size:

%macro testit(arg1); %put &arg1; %mend testit;


Now, what I want to happen in this case is to have the text "a&b" printed. I do get the text printed ok (as long as a macro variable named b doesn't happen to exist), but I also get the log warning about apparant symbolic reference B not resolved.

How can I get values like this to print without attempting attempting the macro variable substitution? I tried using %nrquote and even %superq in the %put statement, and that didn't have any effect (I didn't really think that it would). Surely I must be overlooking something obvious...?

Thanks, s/KAM

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