proc report with only system date no time

Reply
N/A
Posts: 0

proc report with only system date no time

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?
SAS Super FREQ
Posts: 8,645

Re: proc report with only system date no time

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
N/A
Posts: 0

Re: proc report with only system date no time

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".
SAS Super FREQ
Posts: 8,645

Re: proc report with only system date no time

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]
Post a Question
Discussion Stats
  • 3 replies
  • 579 views
  • 0 likes
  • 2 in conversation