Date: Fri, 30 Mar 2001 16:20:17 -0500
Reply-To: "Fehd, Ronald J." <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <rjf2@CDC.GOV>
Subject: Re: %nrstr or similar
Content-Type: text/plain; charset="iso-8859-1"
> From: Casey Pierce [mailto:casey@SDAC.HARVARD.EDU]
> I was wondering if there's a macro function that undoes
> %nrstr. What I'm trying to do is define a macro variable (OUTTABLE)
> based upon the values of a couple other macro variables
> whose values will change. I can't define OUTTABLE after the
> changing macro vars because it, too, will occasionally change.
> What I have right now is:
> %let OUTTABLE = %nrstr(dar_&STUDYNUM._&PLA..lst);
> %let STUDYNUM = 388;
> %let DERIV = PLA;
> <then the main macro calls OUTTABLE>
> %let STUDYNUM = 398;
> %let DERIV = PEL;
> <then run the main macro again>
It is unclear to me why you are whining about being unable to use this
statement again:
%let OUTTABLE = dar_&STUDYNUM._&PLA..lst;
If, in fact, this declaration is a constant declaration
then put it in a file by itself and %include it
> The problem is that &OUTTABLE only resolves in file statements.
then why are you bothering to define a macro variable with this value?
you are using two steps:
1. define OUTTABLE
2. reference OUTTABLE in file statement
when you could just use:
reference dar_&STUDYNUM._&PLA..lst in file statement
> I have some printtos involving the variable that don't resolve
> as well as some UNIX commands that also aren't resolving.
> Is there a command to force resolution or can anyone see another
> way around this?
<advertisement>
%include or %macro?
this concept is explained in my SUGI-26 paper in Beginning Tutorials:
A Beginner's Tour of a Project using SAS(r) Macros
see you in Long Beach!
</advertisement>
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
OpSys: WinNT Ver: 8.1
---> cheerful provider of UNTESTED SAS code!*! <---
archives: http://www.listserv.uga.edu/archives/sas-l.html
By using your intelligence you can sometimes make your problems twice as
complicated.
-- Ashleigh Brilliant