Date: Wed, 7 May 2008 14:00:14 -0400
Reply-To: jrholdcraft@AEP.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Jennifer R. Holdcraft" <jrholdcraft@AEP.COM>
Subject: macro var resolution issue (&&maxdate_%eval(&j+1))
Content-Type: text/plain; charset="US-ASCII"
A coworker of mine is having an issue getting a macro variable to resolve
as expected (or at least resolve without a warning message) and I
can't figure it out myself either.
The situation is something like this - there's a loop where she's creating
a number of different macro variables named maxdate_2, maxdate_3,
etc. that hold character date values like 30Nov08.
She also has a counter macro var called j that holds the number of the
loop. The macro var necessary is maxdate_ type with the j+1 number
(i.e. if j=2 then want to use the maxdate_3 macro value)
She is trying to get the combination of these to resolve to "30Nov08"d -
and was trying something like:
%put "&&maxdate_%eval(&j+1)"d;
This seems to work but keeps generating a warning in the log saying
"Apparent symbolic reference MAXDATE_ not resolved". Is there
any way to get the result "correctly" without generating the log warning?
Can we just ignore it?
The only way I can figure out how to do this without generating a message
in the log was to make a larger change by removing the underscore
from the maxdate_2 type naming conventions - to say maxdate2, and then
making sure the &j is the right number you need (rather than one behind)
by doing something like %let k=%eval(&j+2) and then using &&maxdate&k but
I figured I'd ask the list if anyone knew a way to do it with the
definitions she already has.
Thanks!
Jennifer R. Holdcraft
System Analyst, Market Risk Analytics
American Electric Power
614-583-6761, Audinet 220-6761
Cell: 614-307-4258
jrholdcraft@aep.com