Date: Fri, 8 Dec 2006 15:37:50 -0500
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: Storing macros
Content-Type: text/plain; charset="US-ASCII"
> From: alves
> To store macros I added to my autoexec.sas file the following
> instructions:
> LIBNAME Mymacros "c:\alves\sas\code";
> OPTIONS MSTORED SASMSTORE=Mymacros;
>
> and then in each macro that I want to store i add /STORE at
> the end of the %macro... instruction.
>
> I am working on four projects and while some macros are
> common, the large majority is project specific. Is there
> anyway of storing macros in different files and still have
> access to all of them in the same SAS session?
>
> The idea is to have MYMACROS_PROJ1, MYMACROS_PROJ2,
> MYMACROS_PROJ3, MYMACROS_PROJ4, MYMACROS_UTILS (or something
> similar, this is just to have an idea) and use them all if I need.
The issues of storage of compiled macros are discussed in this paper:
Tutorials
A SASautos Companion: Reusing Macros
http://www2.sas.com/proceedings/sugi30/267-30.pdf
You will need a custom autoexec for each project folder.
but see below for a solution with one site autoexec.sas.
You do not want to have multiple copies of site macros.
You may be able to get away with one autoexec,
but you will still need a project configuration file
to allocate an environment variable with the project macro folder.
- - sashome\sasv9.cfg - -
-set sitemacros '<site macro folder>'
- - <project>sasv9.cfg - -
-set projmacros '<this project macro folder>'
- - sashome\autoexec.sas - -
LIBNAME SiteMacr "!sitemacros";
libname ProjMacr "!projmacros";
OPTIONS MSTORED SASMSTORE=(ProjMacr SiteMacr);
Ron Fehd the macro reuse maven CDC Atlanta GA USA RJF2 at cdc dot gov