LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2004, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 11 Jun 2004 16:44:00 -0500
Reply-To:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject:   Re: (OT) old style macro is still working
Comments:   To: chang_y_chung@HOTMAIL.COM
Content-Type:   text/plain; charset=us-ascii

For the, the most useful techniques for avoiding macros are:

- Using PROC SQL with the :INTO clause to generate code.

- Using BY groups.

- Using CALL EXECUTE to write data-dependent code.

- Using PUT to write data dependent code to a temporary file, then %INCLUDEing that file.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA

>>> "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM> 06/11/2004 2:32 PM >>> On Thu, 10 Jun 2004 15:45:39 +0000, Ian Whitlock <iw1junk@COMCAST.NET> wrote:

>... If you like the simplicity just avoid writing >macros. Having no parameters does make code simpler, albeit >less flexible.

Hi,

I totally agree with you on that it is wonderful that sas keep things so that things work even after two decades of upgrades.

With all the due respect, however, I guess I disagree on three points. One: the lack of parameters can be readily overcome:

macro _put2log data _null_; put _line; run; %

macro _line "this is a test line" % _put2log

macro _line "another test line" % _put2log

Two: name conflicts are not completely disappeared with modern-style macros, either -- and can be avoided by applying styles or guidelines strictly, also as shown above. And finally, I would like to avoid macros, if I can. Maybe it is just me, but as long as I am to be proficient in sas, there seems to be no way avoiding macros. I would love to hear about ways to not using macros.

Cheers, Chang


Back to: Top of message | Previous page | Main SAS-L page