Date: Wed, 13 Aug 2008 11:49:11 -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: Parameterized Includes was: Macro Hubris
In-Reply-To: <482249F865060740AE33815802042D2F01643DE5@LTA3VS012.ees.hhs.gov>
Content-Type: text/plain; charset=us-ascii
subject: RE: Monday/Macro Humor
or Hubris, ... whichever
Much to my surprise, commentary did not focus on the whizardry
that could be accomplished by macro statements, such as %if or %do for
loops
Many of the comments I read on- and off-list
referred to the macro autocall facility
which provides an automatic search for files containing macros
in folders that sas provides
and which can be modified to include folders containing site or project
macros.
I have added some information to my sas wiki page
about how to allocate a fileref for multiple folders for this task.
http://tinyurl.com/5apsw2
http://www.sascommunity.org/wiki/Parameterized_include_file
pretty simple:
3 filename Includes ('.'
4 'c:\SAS-site\includes' );
5 options source2;
6 %Include Includes(FileA FileB);
NOTE: %INCLUDE (level 1) file INCLUDES(FileA)
is file c:\SAS-site\includes\filea.sas.
7 +%Put Note2: C:\SAS-site\includes\FileA.sas;
Note2: C:\SAS-site\includes\FileA.sas
NOTE: %INCLUDE (level 1) ending.
NOTE: %INCLUDE (level 1) file INCLUDES(FileB)
is file C:\Temp\sas\fileb.sas.
8 +%Put Note2: C:\Temp\sas\FileB.sas;
Note2: C:\Temp\sas\FileB.sas
While sas provides the special word 'sasautos' to refer to the aggregate
collection of folders
when using parameterized includes the main problem I see in
standardizing their usage
is agreement on the fileref, in above example 'Includes';
As always, I am open to suggestions for this fileref name.
Ron Fehd the parameterized include
xor macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
see also: A SASautos Companion: Reusing Macros
http://tinyurl.com/45nzzk for:
http://www2.sas.com/proceedings/sugi30/267-30.pdf