setting a date in a SAS footnote

Reply
Occasional Contributor
Posts: 10

setting a date in a SAS footnote


Rookie question:

How do I set todays date in the footnote of a recurring report in SAS.   I'm using ODS to an html file and want to have the current date in the footer.   Thanks, John

Super Contributor
Posts: 358

Re: setting a date in a SAS footnote

use:

  footnote .j=r "&sysdate9 &systime";

but remember that the date and time here is the date the SAS session started, so if you keep your session open for long periods of time (I keep them open for days), the date will be incorrect.  In that case you need to set your own macro variable in your program.

Trusted Advisor
Posts: 2,113

Re: setting a date in a SAS footnote

Here is the footnote that EGuide generates.  It will put today's date and time in the footer.

FOOTNOTE1 "Generated by the SAS System (&_SASSERVERNAME, &SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";

Note the use of double-quotes so the macro variables will resolve.

Note, also, that HTML generates one (potentially very long) page, so the footer will only appear once.

Doc Muhlbaier

Duke

Super User
Posts: 5,085

Re: setting a date in a SAS footnote

With slightly more work, you can control the format in which the date appears.  Here, for example, you'll get YMD:

footnote .j=r "%sysfunc(today(), yymmdd10)";

Good luck.

Occasional Contributor
Posts: 10

Re: setting a date in a SAS footnote

Thnks All! 

Ask a Question
Discussion stats
  • 4 replies
  • 1160 views
  • 7 likes
  • 4 in conversation