Adding Customized Dates

What if you want a different format than "hh:mm dddd, MMMM dd yyyy"? And what if you want both a dynamic date that indicates when the file was last opened, and a static date that indicates when the file was created? You can do this, but you'll need to turn off the system dates and create your own, as demonstrated in the following code:

OPTIONS NODATE;
%let sdate=%sysfunc(putn("&sysdate"d,worddate.));
title justify=right '{Current date: \field {\*\fldinst { DATE \\@
"MMMM d, yyyy" \*\MERGEFORMAT}}}';
title2 justify=right "Report generated on: &sdate";
ODS RTF FILE='BothDates.rtf';
proc print data=clips;
run;
ODS RTF CLOSE;

The %LET statement creates the macro variable SDATE, whose value is inserted as the static date value ...

Get Output Delivery System: The Basics and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.