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 (May 2005, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 25 May 2005 00:11:49 +0000
Reply-To:     iw1junk@COMCAST.NET
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ian Whitlock <iw1junk@COMCAST.NET>
Subject:      Re: macro quoting functions

John,

First of all certain macro instructions must be compiled in a macro. %DO is one of them. Hence there is no form of unquoting that can revive

%NRSTR(%DO z = 1 %to 3;)

Second of all DEQUOTE is a DATA step function for handling single and double quote marks, i.e. DATA step quoted values. It has nothing to do with undoing macro quoting. You could use

%unquote(&file_create)

for this task, but that still cannot get around the fact that the macro compiler did not see the %DO!

Now you obviously have a problem, but you have said nothing about that problem. You have only asked about a non-working solution. So there is very little to help you with until you give the problem.

I suppose one answer to your cut down solution would be

%macro test ( mac=loop(n=3) ) ; %&mac %mend test ;

%macro loop ( n = 1 ) ; %local z ; %do z = 1 %to &n ; %put x=&z ; %end ; %mend loop ;

%test(mac=loop(n=4))

But I doubt that it will help much in your real problem since TEST doesn't seem to have anything to do but invoke another macro.

You also might try contacting "Wright, Wendi" <wwright@ETS.ORG> since she should be able to give you a lot of macro advice.

Ian Whitlock ================= Date: Mon, 23 May 2005 19:35:41 -0400 Reply-To: "Bonett, John" <jbonett@ETS.ORG> Sender: "SAS(r) Discussion" From: "Bonett, John" <jbonett@ETS.ORG> Subject: macro quoting functions Content-type: text/plain; charset=iso-8859-1 Hello all, In a scaled down example for SAS 9.1.3, I'm trying to replace the %Do statement with a macro such as the one commented out to get the same results. Obviously it didn't work. I'm relatively new with macro quote functions so I'm not sure if this is feasible or not. Your suggestions are welcome. And as always, thank you in advance. John

%LET file_create=%NRSTR(%DO z=1 %TO 3;); %macro test; %DO z=1 %TO 3; %*SYSFUNC(dequote(&file_create)); %PUT x=&z; %END; %mend test; %test;

***************************************************************** ********* This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender; do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited. Thank you for your compliance.


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