> Create your own &MY_SYSDATE by using the &SYSDATE9
> variable, converted to a SAS NUMERIC DATE, using
> INPUT, and follow that with a suitable PUT to
> re-format to your own date-variable value. Explore
> using %SYSFUNC(...) along with suitable SAS functions
> to do the data conversions, mentioned above.
>
> Scott Barry
> SBBWorks, Inc.
gzr2mz39
As Scott suggests - use %sysfunc()
The common route to reformat dates, uses the second parameter of %sysfunc() - a format for the results when the first parameter is a numeric function {like inputN() }
"Today" is much easier, than yesterday, which I would format like
%put yesterday was %sysfunc( intnx(day, "&sysdate9"d, -1), weekdate ) ;
The simpler equivalent for today (needing no intnx() function )
%put today is %sysfunc( putN("&sysdate9"d, weekdate ) ) ;
Alternatively, when using a SAS server which may have started before today (SAS session start time provides the underlying value in &sysdate and &sysdate9), use the today() function like
%put today is %sysfunc( today(), weekdate ) ;
When presenting timestamps, I like the SAS Title style :
%put now it is %sysfunc( datetime(), twmdy ) ;