Date: Tue, 23 May 2000 11:36:51 -0400
Reply-To: WHITLOI1 <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: WHITLOI1 <WHITLOI1@WESTAT.COM>
Subject: Re: Clarification: How to find out the name of the Macro exec
Content-Type: text/plain; charset=US-ASCII
Dennis,
Here is a simple solution that depends on one line of code in each macro.
%local macname ;
I have written macro Q as SQL code however one could write NEWQ using %SYSFUNC
and DATA step functions to read the view and hence avoid step boundaries. In
this case one could
add
%let macname = %newq() ;
to fill in the value of macname. Here is my test code.
%macro a (dummy) ;
%local macname ;
%q()
%put executing &macname ;
%b
%q()
%put executing &macname ;
%mend a ;
%macro b (dummy) ;
%local macname ;
%q() ;
%put Now executing &macname ;
%mend q ;
%macro q (dummy) ;
proc sql noprint ;
options nolabel ;
select scope into: macname
from dictionary.macros
where name = "MACNAME" ;
;
quit ;
%mend q ;
%a()
Ian whitlock <whitloi1@westat.com>
____________________Reply Separator____________________
Subject: Clarification: How to find out the name of the Macro executi
Author: Dennis Diskin <Dennis.Diskin.B@BAYER.COM>
Date: 5/23/2000 10:42 AM
Thanks all but, I guess I was not clear enough. My question is:
Can I find out the name of the macro from within the macro code without
hardcoding it into the program?
Ie. is there a system macro variable/function or sashelp view that might have
this info ?
> Is there any way to find out the name of the currently executing macro or
> where
> the macro was called from ?
>
> Dennis Diskin