Date: Mon, 11 Apr 2011 16:02:18 +0000
Reply-To: "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Subject: Re: get name of current include file
In-Reply-To: <BANLkTimkk7OXALcvd8mfA-P+mVY7mQWD+w@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
> From: Quentin McMullen
> Sent: Monday, April 11, 2011 11:36 AM
> Subject: get name of current include file
>
> Hi All,
>
> Was wondering if there was an easy way to find the name of the
> currently executing include file.
>
> So imagine I have several include modules called by a driver program.
> So driver.sas looks like
> %inc code(module1.sas);
> %inc code(module2.sas);
> %inc code(module3.sas);
>
> I would like user-generated warnings etc to specify which module had
> an error, but I don't want to hard code the name of the module.
>
> In this scenario, both SYSIN and SAS_EXECFILENAME will return the name
> of the driver program (even when referenced inside of a module).
> Which is the expected behavior. But was hoping there was an easy way
> to get the name of the include module instead (I'm guessing maybe
> means hitting the dictionary.extfiles...).
>
> On a related note, is there an option somewhere that would prefix
> lines written to the log from /source2 option with the name of the
> include module, similar to mprint / mprintnest does for macros?
>
> Kind Regards,
> --Quentin
Quentin: there is no easy solution to this,
meaning: no options.
"Read the log!"
otherwise: add statements to programs
Here is what I have developed:
1.
Writing Testing Aware Programs
http://tinyurl.com/64xswz
for this page
Writing Testing-Aware Programs that Self-Report when Testing Options are True
http://www.sascommunity.org/wiki/Writing_Testing_Aware_Programs
see also:
2.
Journeymen's Tools: Two Macros, ProgList and PutMvars, to Show Calling Sequence and Parameters of Routines
http://www2.sas.com/proceedings/sugi30/004-30.pdf
Keywords: include fan-in fan-out job oplist parameter, macro
Ron Fehd the macro maven