BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

How can I generate a report with just the system date displayed and no time shown.
Is this possible using any options r how could b done?
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
What is your destination of choice?? LISTING window?? ODS HTML?? ODS RTF?? ODS PDF?? The technique is to use the NODATE system option and then to put the system date in a title or footnote:
[pre]
options nodate number;
title "Created on: &sysdate";
footnote "Created on: &sysdate9";
[/pre]

ODS RTF, ODS PDF and ODS HTML also support "placement options to left, right or center justify the title or footnote string:
[pre]
options nodate number;
title j=r "Created on: &sysdate";
footnote j=l "Created on: &sysdate9";
[/pre]

And, RTF and PDF with ODS also support the Page X of Y page numbering using "escape character" functions.
[pre]
options nodate nonumber;
ods rtf file='c:\temp\xofy.rtf';
ods pdf file='c:\temp\xofy.pdf';
ods escapechar='^';
title j=c "Created on: &sysdate"
j=r "^{thispage}";
footnote j=l "Created on: &sysdate9"
j=r "^{thispage} of ^{lastpage}";
** your code;
ods _all_ close;
[/pre]

cynthia
deleted_user
Not applicable
Thanks for your reply. That gave an idea. But the report is in PDF and also has up to 41 pages generated by using proc report. The page # needs to be incremented automatically for each page consecutively.
Also with Date value, is it possible to get it in different format of current date for eg "Friday, August 2008".
Cynthia_sas
SAS Super FREQ
Hi:
The page number in SAS is always incremented by 1. If you run this program, you will see 3 pages of output -- the formatted date is in the title and the footnote -- you decide where you want to see the date and page and in what format for the date. I show using the WEEKDATE. format. The title shows the simple page number, the footnote shows the X of Y page number.

cynthia
[pre]
options nodate nonumber pageno=1;

options orientation=portrait;
ods pdf file='c:\temp\xofy.pdf';
ods escapechar='^';
title j=l h=10pt "Created on: %sysfunc(today(),weekdate.)"
j=r h=10pt "^{thispage}";
footnote j=l h=10pt "Created on: %sysfunc(today(),weekdate.)"
j=r h=10pt "^{thispage} of ^{lastpage}";

proc print data=sashelp.shoes( obs=100);
run;

ods _all_ close;
[/pre]

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 3 replies
  • 2998 views
  • 0 likes
  • 2 in conversation