Date: Tue, 20 May 2008 10:40:16 -0400
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: SAS macro
In-Reply-To: <842b03fb-41c7-4978-8a25-e7340311c643@24g2000hsh.googlegroups.com>
Content-Type: text/plain; charset=us-ascii
> From: Aj
> Hi All
>
> I have a set of macros( with 6 separate codes) , and a master file
> which passes the initial set of values to the macros .
> Is there a short cut to find out which macros is called when and what
> values are passed for the macros without manually tracking each of
> the passes .
> Please advice.
>
> Thanks
> Aj
Ah, no, there may be no short-cut
the long way is to have a discipline that has either your master file
or your macros self-reporting.
I have presented a paper
Writing Testing-Aware Programs
http://tinyurl.com/64xswz for
http://www.sascommunity.org/wiki/Writing_Testing_Aware_Programs
that shows some methods for both data step and macro
** data step:;
attrib Testing length = 4;
*whichever option you want to use that turns on the self-reporting;
*note: source2 controls echo of %included programs;
retain Testing %eval(0 or %sysfunc(getoption(Source2)) eq SOURCE2);
*...;
if Testing then putlog Stmnt=;
** macro;
%Macro CxMacro
(data =
,Testing = 0
);
%Let Testing = %eval(&Testing
or %sysfunc(getoption(MPRINT))
eq MPRINT );
%If &Testing. %then %put _local_;
*...;
run;%mend;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov