| Date: | Fri, 16 Dec 2005 19:55:24 -0800 |
| 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: Call Execute |
| In-Reply-To: | <200512170336.jBGNZ5mL014958@mailgw.cc.uga.edu> |
| Content-Type: | text/plain; format=flowed |
|---|
jiann-shiun.huang@AMERUS.COM wrote:
> I have a question on how to distinguish between SAS statement and macro
>language element. Specifically I want to know when CALL EXECUTE is
>executed at the next DATA step boundary and when it is executely
>immediately as described in help window:
>
>"resolves its argument and executes the resolved value at the next step
>boundary (if the value is a SAS statement) or immediately (if the value is
>a macro language element)."
First, I have to admit that SAS docs read as if they were written for people
who
already know the material. That does take some work.
But the meaning is actually straightforward. Work out what the thing inside
the CALL EXECUTE() parentheses is, by doing any macro variable parsing or
text substitution needed, along with filling in anything from the data set.
Now
look at it.
Is it a regular SAS statement or a series of them, like a proc step or a new
data
step? If so, then slap it on a queue, and execute all those things once you
have
passed the step boundary (like that RUN statement at the end of your DATA
step).
Is it a macro call, or some macro code? Then it gets executed immediately,
without waiting for the next step boundary.
Which may be just what you DON'T want to happen. Lots of times we want
the series of macro calls to execute right *after* the step, so you can put
the
macro call inside single quotes to get that effect. There's a section on
these
sorts of timing issues in Art Carpenter's macro book, and I highly recommend
that you take a look there for more detail and some examples.
HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
|