Date: Tue, 16 Dec 2008 17:30:56 -0500
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>"
<schreier.junk.mail@GMAIL.COM>
Subject: Re: automatic macro variables
On Tue, 16 Dec 2008 13:24:38 -0800, dc353@hotmail.com <dc353@HOTMAIL.COM> wrote:
>On Dec 16, 3:45 pm, r...@CDC.GOV ("Fehd, Ronald J. (CDC/CCHIS/NCPHI)")
>wrote:
>> > From: dc...@hotmail.com
>>
>> > I run the following code
>>
>> > %put _all_;
>> > data _null_;
>> > day= weekday("16DEC2008"d);
That really does not tell you anything. Replace it with
day= weekday( today() );
>> > put day;
>> > run;
>>
>> > The log below shows &sysday = Thursday and the put statement is
>> > returning 3 which represents the correct day of week Tuesday. The
>> > system date is correct and these are the very first statements run
>> > when SAS is started. Is there anyway to reset &sysday ??
>>
>
>Ron,
>
>Thanks. But that's the problem - SAS was restarted and then these
>commands were immediately submitted. (the machine was rebooted) The
>problem is not related to &sysdate which is correct, the actual pc
>date and time are set correctly. For some reason &sysday is incorrect
>> you are working too hard or too long;
>> shut down your SAS session every once in a while
>> the automatic macro variables are set on startup
>> you cannot reset them
>>
>> you can use the DateTimeReset option to reset the date in title1:
>>
>> options dtreset;
>>
>> Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
>>
>> > 1 %put _all_;
>> > AUTOMATIC SYSDATE 16DEC08
>> > AUTOMATIC SYSDATE9 16DEC2008
>> > AUTOMATIC SYSDAY Thursday
>> > AUTOMATIC SYSTIME 13:52
|