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
In-Reply-To: <862566A2.00497CE1.00@zsserver3.zsassociates.com>
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.
i.e.,
%TEST; ==> uses _LAST_
but
%TEST(dataset=PERM.CUSTOMRS); ==> uses PERM.CUSTOMRS
HTH
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.)
|