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 (March 2001, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Casey Pierce <casey@SDAC.HARVARD.EDU>
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 OpSys: WinNT Ver: 8.1 ---> cheerful provider of UNTESTED SAS code!*! <--- archives: By using your intelligence you can sometimes make your problems twice as complicated. -- Ashleigh Brilliant

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