Date: Tue, 17 Oct 2006 13:23:40 -0700
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: How to reference a macro vatiable generated from a macro
within a separated macro
Content-Type: text/plain; format=flowed
>thank you for taking time to answer my question.
>what I am trying to do is create a macro varaible on the fly and use it in
>later part of program.
Why? And why make the second part of the process so hard?
Really. I'm (trying to be) serious about this.
First off, I don't like creating global variables if I don't have to. I
like to carefully control my macro variable scope so I don't have to
worry about things like namespace collisions and making macros too
unwieldy to re-use.
Second, there are other ways to compute a data point (or a bunch
of them) and have the data available later in the program. A macro
variable may be a good approach, but it is not the only approach.
Third, using that created macro should be *transparent*. It is,
after all, just the 'text substitution' you talked about earlier. Needing
an entire data step to cope with it seems counter-intuitive.
Fourth, a complex process may be a lot easier to write the first
time if you start out with a non-macro solution (that may only work
for special case) and then macro-ize it to get what you need.
>I know I can take out the data _null_ and run statements from first macro,
>but there going to be many many repeated statements in one datastep when it
Why? What do the "many many repeated statements" do?
You may have a situation that is screaming for a macro solution.
But you may have a situation which is done better with other
>Do you have any suggestion or idea of how to make it happen?
My suggestion here is for you to explain in great detail what your
process needs to do, and why, so that the people on SAS-L can
give you better advice than the kvetching above.
David L. Cassell
3115 NW Norwood Pl.
Corvallis OR 97330
Use your PC to make calls at very low rates