Date: Tue, 20 Apr 1999 10:09:52 -0400
Reply-To: "Ward, David" <dward@INNOVEX-DAS.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Ward, David" <dward@INNOVEX-DAS.COM>
Subject: Re: Unfinished SAS-L Live from Miami Beach business
Having not attended the Miami Beach Live SAS-L (though I was present
in Miami), I'm a little hesitant to reply to a message with such a subject,
but I thought you might like to see a relevant and very useful macro ...
Since a few postings along this thread have shown useful macros to
build footnotes, consider this one, a macro function (that's what I call
macros that resolve a desired value) that returns the current program loaded
in the program editor (well, let's say 9/10 times). The macro reads the
view sashelp.vextfl, which contains information about the most recently
accessed files. The first record is almost always your program, whether it
is loaded in the program editor or called by a %include.
/** OPEN SASHELP VIEW VEXTFL WHICH CONTAINS EXTERNAL FILES
/** MOVE THROUGH EACH RECORD LOOKING FOR A VALID SAS PROGRAM **/
/** EXCLUDE SASAUTOS, AUTOEXEC, SASMSG FILES **/
%if %sysfunc(getvarc(&dsid,1))^=%sysfunc(getoption(sasautos)) and
%if %quote(&currprog)= and &rc=0 %then %goto tryagain;
/** PUT OUT THE CURRENT PROGRAM IF FOUND **/
I have been using this for over a year in standard footnotes to
return the program name.
- D. Ward