Date: Sat, 5 Nov 2005 01:37:48 +1100
Reply-To: Scott Bass <usenet739_yahoo_com_au@ALFREDO.CC.UGA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Scott Bass <usenet739_yahoo_com_au@ALFREDO.CC.UGA.EDU>
Subject: Re: Forcing SAS to print the resolved value of macro variables in
Thanks Ron, that was a typo. That will teach me to try to improve the
posted testcase without retesting. I've corrected the code below.
"Scott Bass" <usenet739_yahoo_com_au> wrote in message
> Submit this code:
> 1 options mprint;
> 2 %let foo=bar;
> 3 title "&foo"; <<<<<
> 4 %macro foo;
> 5 title "&foo";
> 6 %mend;
> 7 %foo;
> MPRINT(FOO): title "bar"; <<<<<
> I wish there was some way I could force line 3 in the log to be the
> resolved value of the macro variable, like line 7, rather than the macro
> variable reference.
> We have an SDLC requirement to document the test cases within our
> programs. The problem is, our test case documentation was always out of
> sync with the test cases in the programs themselves.
> Therefore, I wrote a Perl script (thanks comp.lang.perl but, man, what a
> TOUGH crowd on the newbies) plus a bit of SAS (thanks Richard) that parses
> .sas or more often .log files for specially formatted comment blocks, and
> generates the test case documentation. This is analogous to JavaDoc or
> Perl POD, where the documentation for the program is embedded in the
> program itself.
> I've encountered a problem, for which I need to come up with a
> workaround/best practice. If the documentation block contains macro
> variable references, outside of a macro, the SAS log will print the macro
> variable reference, rather than the resolved value. Therefore, the
> reference, rather than the value, ends up in the doc.
> My Perl script does handle/parse out the "MPRINT (FOO):" text, so the
> immediate workaround is to force the end user to use a macro if the test
> case block contains macro variables. However, this does add
> complexity/additional code, just to get the log to read "properly". I was
> hoping there was some magical, undocumented, whizbang SAS option that
> would give me what I want.
> Or some brilliant idea/alternate approach/workaround from a fellow