Date: Sun, 13 Jun 2004 20:11:24 -0700
Reply-To: Dale McLerran <stringplayer_2@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dale McLerran <stringplayer_2@YAHOO.COM>
Subject: Re: Macro [ab]usage (was: (OT) old style macro is still working)
Content-Type: text/plain; charset=us-ascii
--- "Paul M. Dorfman" <sashole@BELLSOUTH.NET> wrote:
> There is also a place for CALL EXECUTE, which in my view is most
> of the time handy when code to be assembled is faily simple and
> not quite voluminous. It it also nice that the code concocted by
> EXECUTE is echoed in the log with line numbers that (unlike MPRINT)
> can be actually referenced should a run-time error occur. This is
> of course also true for the old reliable PUT->file->%include,
> which IMHO affords the greatest flexibility and and maintainability
> (including referenceable log line numbers and code retention) of
> them all.
CALL EXECUTE is a marvelous tool for the situation where the code
that is written depends on values in a dataset. I concur with
Paul that CALL EXECUTE is not well suited for jobs where the code
volume is large. This is at least in part due to the writing of
data step code within a data step. It is particularly important
to keep clear which part of the code you are writing is current
data step code dependent on values in a dataset to be used to
control the data step code which is to be executed when the stack
is popped. The larger the code volume, the more difficult it can
be to keep track of which step you are writing for. Obviously,
the same would hold true for the PUT->file->%include approach.
In my opinion, the macro language does not suffer this problem.
Having stated that there can be problems with data step approaches
to writing data step code, I must say that I have been finding
myself constructing more and more code employing CALL EXECUTE and
relying less on the macro language in recent months. I really did
not have any great appreciation for CALL EXECUTE until recently.
Having come to an appreciation of what CALL EXECUTE enables with
relative ease, I heartily encourage anyone who depends solely on
the macro language to look at portions of their code which depend
on data elements to see if the code can be improved by switching
from macro language to other methods of code generation, be it
CALL EXECUTE or PUT->file->%include.
Fred Hutchinson Cancer Research Center
Ph: (206) 667-2926
Fax: (206) 667-5977
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.