Date: Fri, 18 Jul 2008 10:08:26 -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: List Macro path without executing macro
In-Reply-To: <81bda7ae-15eb-41af-beda-56653e434549@w39g2000prb.googlegroups.com>
Content-Type: text/plain; charset=us-ascii
> From: Patrick
>
> I have a piece of code with a macro call - but I don't know where the
> macro comes from.
>
> How can I get the location of the macro - it could be in an autocall
> library (sasautos) or in a catalog (sasmstore).
>
> I've seen the MAUTOLOCDISPLAY option - but how to use it without
> executing the macro?
when you solve this problem,
you graduate from being a user to being a programmer.
0. find your autoexec which may redefine any of the options associated
w/macro use
1. list the SASautos fileref
filename SASautos list;
2. list the SASautos option:
Proc Options define value option = SASautos;
%Put SASautos:%sysfunc(getoption(SASautos));
3. now you know the folders that contain SAS-supplied macros
go to !sasroot
C:\Program Files\SAS\SAS 9.1
and look under each product you have licensed for the folder sasmacro:
C:\Program Files\SAS\SAS 9.1\access\sasmacro
C:\Program Files\SAS\SAS 9.1\assist\sasmacro
C:\Program Files\SAS\SAS 9.1\...\sasmacro
C:\Program Files\SAS\SAS 9.1\stat\sasmacro
4. catalogs
4.1 find the libref containing the catalog:
%Put SASmStore:%sysfunc(getoption(sasmstore));
4.2 if libref in sasmstore meaning macros are available in a catalog,
list the libref folder:
filename %sysfunc(getoption(sasmstore)) list;
which does not tell you where the file containing the macro definition
is located
it tells, as you asked, whether the macro is in a catalog.
From which folder it was compiled and stored is still a Q.
5. read the paper:
http://www.sascommunity.org/wiki/SASautos_Companion_Reusing_Macros
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov