Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SYSDATE not current 1

Status
Not open for further replies.

DanJR

Technical User
Oct 29, 2002
392
AU
Win 98
SAS v8.02

I have a macro which contains a PROC SQL procedure and the current date (&SYSDATE) is used within the PROC SQL procedure.

Everything works fine, until last night when I left SAS open over night and came to work this morning, ran my macro (e.g. %myMacro), then found that &SYSDATE was outputting as yesterday! I checked my computers clock and its date was correct. I "re-submitted" the macro and still the same porblem. I tested &SYSDATE using a put statement inside a data step and still the saome problem. I then closed SAS and opened it back up, and &SYSDATE returned the correct date.

The confusing bit is that I checked my "SAS Guide to Macro Processing, version 6" book and it states that SYSDATE "gives the date on which the SAS job started execution".

Is this a bug, or am i misinterrupting something?

Thanks,
Dan.
 
I think that SYSDATE is the date the SAS session was started (as is shown in the page headers in your output file).

Use today() instead, that will return todays date for you.
 
In fact, I just checked this out on the SAS documentation site, and here is the offical answer:-

SYSDATE: the character value representing the date a SAS job or session began executing (two-digit year)

For more info check out


And select Base SAS Software > SAS Macro Language Reference > Macro Variables.

Enjoy.
 
Thanks Chris for your help. I'll use TODAY as you suggest..

Cheers,
Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top