Date: Fri, 21 May 2004 08:01:12 -0500
Reply-To: "Dunn, Toby" <tdunn@TEA.STATE.TX.US>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Dunn, Toby" <tdunn@TEA.STATE.TX.US>
Subject: Re: Scope of Macro Variables
Content-Type: text/plain; charset="us-ascii"
Whew, man I thought you had gone off the deep end with all macros have
to have parameters. Glad to know I haven't lost it yet. But I would
have to agree with you here, as a general rule if you can't see the
macro it should have 1.) a very clear meaning within the program design
and 2.) a macro naming scheme that is easy to understand, 3.)as well as
passing some sort of parameter, other wise I submit that the first two
have to happen an a %include used.
Toby Dunn
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Fehd, Ronald J. (PHPPO)
Sent: Friday, May 21, 2004 7:49 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Scope of Macro Variables
> From: Quentin McMullen [mailto:quentin_mcmullen@BROWN.EDU]
>"Quentin McMullen" <quentin_mcmullen@BROWN.EDU> wrote:
>Agree with Ron, that a macro without any parameters is a silly macro
ah, well, now that I have a lot of others behind me,
I'll qualify my statement, just to keep things interesting.
macros occur in several places:
* SAS-provided directories aka SASautos
* site-provided directory of macros
* project directory, i.e.: SASinitialFolder
* within a job==program
a meander thru the SASautos directories
will turn up some SAS-supplied macros without parameters
iirc AnnoMac is one good example
C:\Program Files\SAS\SAS 9.1\core\sasmacro\annomac.sas
Users of Annotate facility
can bring in all the Annotate family of data step macros
with the single line:
%annomac
which effectively %includes Annomac.sas
and all the teeny macros within it.
9 of 40 macros within AnnoMac do not have parmeters.
YeahBut, there is ample documentation in the Annotate manual.
a round-about kludge, yes.
I don't have a real problem with a macro without parameters
**-- within a program --**
that is, where one can read the macro
and see what it is doing
on the same page,
Ian Whitlocks paper in SUGI 29
http://www2.sas.com/proceedings/sugi29/244-29.pdf
contains several example of generating test data within macro loops
and one can find lots of macros within the SAS-L archives
named like
%DOIT
%DOTHIS
etc.
summary:
macro without any parameters
-- in project or site directories --
is a hard-to-understand-exactly-what-it-does macro.
check our most excellent archives:
http://www.listserv.uga.edu/archives/sas-l.html
search for: "%DOI"
substring search: [X]
subject contains:
author's address:
since: Jan 2004
until:
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov