Date: Mon, 4 Jan 2010 17:53:55 -0800
Reply-To: Patrick <patrick.matter@GMX.CH>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Patrick <patrick.matter@GMX.CH>
Organization: http://groups.google.com
Subject: Re: &sysdate question
Content-Type: text/plain; charset=ISO-8859-1
What oloolo tries to tell you here: &sysdate contains the start date
of the SAS session (i.e. the date you connected via SAS EG to the
server).
If you want the date of when the code was executed you have to use the
SAS function date(), i.e:
%let rundate=%sysfunc(date(),date9.);
data a;
format a$7.;
a= "&rundate" ;
run;
proc print;run;
or even better:
%let rundate=%sysfunc(date());
data a;
format a date9.;
retain a &rundate. ;
run;
proc print;run;
|