Date: Thu, 31 May 2012 13:10:02 +0000
Reply-To: Steven Raimi <sraimi@MARKETINGASSOCIATES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Steven Raimi <sraimi@MARKETINGASSOCIATES.COM>
Subject: Re: call symput causes error:Apparent symbolic reference not
Content-Type: text/plain; charset="us-ascii"
I shouldn't have written my (approximate) version without doing the research. During compilation, the macro variable name is put into the current step (i.e., the put statement OP was complaining about), but the value isn't created until program execution. Here's the key portion of the documentation:
[*] You cannot use a macro variable reference to retrieve the value of a macro variable in the same program (or step) in which SYMPUT creates that macro variable and assigns it a value.
[*] You must specify a step boundary statement to force the DATA step to execute before referencing a value in a global statement following the program (for example, a TITLE statement). The boundary could be a RUN statement or another DATA or PROC statement. For example:
From: Data _null_; [mailto:firstname.lastname@example.org]
Sent: Thursday, May 31, 2012 8:50 AM
To: Steven Raimi
Subject: Re: call symput causes error:Apparent symbolic reference not resolved
On Thu, May 31, 2012 at 7:45 AM, Steven Raimi <email@example.com<mailto:firstname.lastname@example.org>> wrote:
Macro variables created by call symput are NOT available until the data step
That's not true they are available as soon as the CALL statement executes. But for practical purposes the are not USED until after the data step ends.