BookmarkSubscribeRSS Feed
jgautreau
Fluorite | Level 6


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

4 REPLIES 4
OS2Rules
Obsidian | Level 7

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.

Doc_Duke
Rhodochrosite | Level 12

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

Astounding
PROC Star

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.

jgautreau
Fluorite | Level 6

Thnks All! 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 6143 views
  • 7 likes
  • 4 in conversation