LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 1998, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Oct 1998 11:47:48 -0400
Reply-To:     Douglas Dame <dougdame@HPE.UFL.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Douglas Dame <dougdame@HPE.UFL.EDU>
Subject:      Re: macro question
Comments: To: hwang@ZSASSOCIATES.COM
In-Reply-To:  <>
Content-Type: text/plain; charset="iso-8859-1"

Hongjie Wang wrote: > > > Dear friends, I have a macro question, do the following two segments of > code equivalent? > > (1). %macro test(datset); > data _null_; > if &datset eq " " then call symput('datset,', '_LAST_'); > run; > ... > ... > > (2). %macro test(datset); > %if %datset eq %str() %then %let datset=_LAST; > ... > ...

So why not do

(3) %macro test(dataset=_LAST_);

That way the macro just defaults to using _LAST_, unless it's invoked with something different specified.


%TEST; ==> uses _LAST_ but %TEST(dataset=PERM.CUSTOMRS); ==> uses PERM.CUSTOMRS


Douglas Dame Shands HealthCare Gainesville FL ---------------------------------------- "The greatest dangers to liberty lurk in insidious encroachment by men of zeal, well-meaning but without understanding." Judge Louis Brendeis, 1928

(sort of like my SAS coding, in fact.)

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