Date: Wed, 14 Apr 2004 08:39:10 -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: symchk: checking for macro variable existance
Content-Type: text/plain; charset="us-ascii"
I did find yesterday that v9.1 has a macro var checker function in it.
Guess ill have to wait till we upgrade to actually see how it works.
Toby
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
RolandRB
Sent: Wednesday, April 14, 2004 5:41 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: symchk: checking for macro variable existance
If you are testing for a global macro variable and you know it can not
have a valid value as null then you can declare it %global again and
then test to see if it resolves to null. If it resolves to null then
you know it was never set up in the first place. Declaring a global
macro variable as global again will not affect its contents. It just
"promotes" it, but if it has already been promoted to being global
then it has no effect. It is one of the more dirty macro tips on my
web site here:
http://www.datasavantconsulting.com/roland/macrotips.html
...in the section on "The Global declaration trick".
Roland
sas@SDAC.HARVARD.EDU (SAS User) wrote in message
news:<Pine.GSO.4.05.10404131045450.10295-100000@jessica.harvard.edu>...
> Thanks everyone for all of your suggestions.
> Problem solved.
>
> -Casey
>
>
> On Tue, 13 Apr 2004, Fehd, Ronald J. (PHPPO) wrote:
>
> > > From: Jack Hamilton [mailto:JackHamilton@FIRSTHEALTH.COM]
> > > I'm not sure what you mean by
> > > "that makes the macro a procedure".
> >
> > i.e., the macro returns/emits one or more SAS statements
> >
> > Don Stanley's solution using SQL
> > was what I had in mind when I said that.
> >
> > Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
> >
> > Efficiency is intelligent laziness. -David Dunham
> > or depending on other's knowledge
> >
|