Date: Wed, 22 Aug 2007 13:29:33 -0700
Reply-To: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject: Re: macro with no params (was: nested macros and leading spaces)
In-Reply-To: <200708222026.l7MAkaET015789@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"
Nice tech-note-digging.
Thanks for sharing.
-----Original Message-----
From: Chang Chung [mailto:chang_y_chung@HOTMAIL.COM]
Sent: Wednesday, August 22, 2007 1:27 PM
To: SAS-L@LISTSERV.UGA.EDU; Terjeson, Mark
Subject: Re: macro with no params (was: nested macros and leading
spaces)
On Wed, 22 Aug 2007 12:55:58 -0700, Terjeson, Mark
<Mterjeson@RUSSELL.COM>
wrote:
>I guess we're both right. and it looks like
>it depends on what version of SAS you are
>using. My results on my machine are different
>that what you show.
>
>1
>2 %macro timestamp();
>3 %*;%sysfunc(datetime(), datetime21.2)
>4 %mend timestamp;
>5
>6 %put It is now %timestamp().;
>It is now 22AUG2007:12:41:04.12().
>
>Please take note the parens are there!
...
hi,
An interesting problem. On my sas 9.1.3 sp4 on winXP does the right
thing
and eats up the parens on the macro invocation. On others, the sas notes
recommend that not using parens as Mark says. It seems that this has
been a
known but not fixed problem (too low a priority) on all platforms of sas
v6
and on some platforms of sas v8. I am not sure about sas v9 other than
winXP.
SAS NOTE V6-MACRO-7463: (no fix available)
http://support.sas.com/techsup/unotes/V6/7/7463.html
SAS NOTE SN-V8+-000448: (problem only for certain platforms)
http://support.sas.com/techsup/unotes/SN/000/000448.html
Cheers,
Chang
|