BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12

I output several pages to pdf. 

I want the footnote's date to appear as ddmmyy10. format. 

But I cannot find the option to do so. The other changes to the footnote are applied correctly. 

 

 




proc template; 
define style Style.MyStyle; parent= styles.HtmlBlue;

style fonts /
'TitleFont' = ("Helvetica",8pt,Bold) 
'headingFont' = ("Helvetica",7pt,Bold) 
'docFont' = ("Helvetica",7pt)
'footFont' = ("Times Roman",6pt)
'FixedStrongFont' = ("Courier",8pt,Bold)
'FixedHeadingFont' = ("Courier",8pt,Bold)
'BatchFixedFont' = ("Courier",5.7pt)
'FixedFont' = ("Courier",8pt);
style color_list /
'bgH' = white /* row and column header background */
'bgT' = white /* table background */
'bgD' = white /* data cell background */
'fg' = black /* text color */
'bg' = white; /* page background color */
style Table from Output /
frame = void 
rules = rows 
cellpadding = 2pt 
cellspacing = 0.0pt 
borderwidth = 0.2pt 
background = color_list('bgT');

 Style PageNo from TitlesAndFooters / 
 font = fonts("footFont") 
 cellpadding = 0 
 cellspacing = 0
 pretext = "página "
 posttext = " de ^{lastpage}"
 just=c 
 vjust=b;

 Style date from TitlesAndFooters / 
 font = fonts("footFont") 
 cellpadding = 0 
 cellspacing = 0
 
/*   sasdate='ddmmyy10.' */
 pretext = "Creado: "
/*  posttext = " de ^{lastpage}" */
 just=r 
 vjust=t;

end;

run;
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

I suspect you are confusing STYLE (font, color etc) with FORMAT (how values are converted to text).

I don't think that ODS style templates have any control over formats.

 

Note that SAS also has templates that control what information is printed from procedures. In theory that type of a template might have a method to control the format used to to display values.  But I doubt it would apply to something like the automatic run date that is generated outside of the procedure.

View solution in original post

8 REPLIES 8
donricardo
SAS Employee

Nesting this inside an ODS statement would do the job, simple and easy:

 

title1 "Student Listing Report";
footnote1 "Reported Created on %sysfunc(today(),ddmmyy10.)";
proc print data=sashelp.class;
run;

donricardo_0-1673626967452.png

 

acordes
Rhodochrosite | Level 12
Thanks.
But that won't work for me because I have 100 pages in the output.
I want to change the ods's footnote.
Like changing the sas sysdate format that is displayed on every page.
Tom
Super User Tom
Super User

@acordes wrote:
Thanks.
But that won't work for me because I have 100 pages in the output.
I want to change the ods's footnote.
Like changing the sas sysdate format that is displayed on every page.

That is as clear as mud.

 

Are you talking about the date that is printed on a TITLE when you use the DATE option?  If so then you cannot control that.  Instead turn OFF the automatic DATE and instead generate your own date string using your own TITLE or FOOTNOTE function.  Does not really have anything to do with ODS or styles.

 

If you are talking about some date that is being generated into a footnote for you then you need to show a working example program that demonstrates the issue.  Supply the data required as a data step or use one of the SASHELP datasets so others can test changes to your program.

acordes
Rhodochrosite | Level 12
I disagree. I could have asked without posting ANY code snippet:
Is there any option in the "proc template...Style date from TitlesAndFooters /" to control for the date format?
As I said, the proc template has its effect on the ods pdf that is generated, i. e. the "Creado:" is added as pretext.
I'm on smartphone now, else I'd add an example code.
But this time I thought it would suffice without.
Tom
Super User Tom
Super User

I suspect you are confusing STYLE (font, color etc) with FORMAT (how values are converted to text).

I don't think that ODS style templates have any control over formats.

 

Note that SAS also has templates that control what information is printed from procedures. In theory that type of a template might have a method to control the format used to to display values.  But I doubt it would apply to something like the automatic run date that is generated outside of the procedure.

acordes
Rhodochrosite | Level 12
I can live with the date printed as it is.
That's only a minor formatting issue.
I'm quite happy with the whole analytics report printed to pdf.
I should move forward.
ballardw
Super User

@acordes wrote:

Is there any option in the "proc template...Style date from TitlesAndFooters /" to control for the date format?


In general, I think not. Footnote text, or footer content, is provided by you. SAS has no way of knowing that you will ever want to include a date value or where that date value might come from.

 

You don't say exactly where the date value comes from. The statement "I want the footnote's date to appear as ddmmyy10. format." is wonderfully vague because footnotes do not have a natural "date" of any sort.

 

Your previous comment: "But that won't work for me because I have 100 pages in the output." may mean that you are doing other stuff with the footnote and not telling us or do not understand that FOOTNOTE statements, like Titles, are in effect until cancelled.

A footnote at the top of the program will provide the same footnote for each output.

Run this program and you will see the same footnote on each page. Replace the <yourpathgoeshere> with something valid for your output.

ods pdf file="<yourpathgoeshere>\exmaple.pdf";

title1 "Student Listing Report";
footnote1 "Reported Created on %sysfunc(today(),ddmmyy10.)";
proc print data=sashelp.class;
   var name;
run;

title1 "Student name and age";
proc print data=sashelp.class;
   var name age;
run;

title1 "Student name and sex";
proc print data=sashelp.class;
   var name sex;
run;

ods pdf close;
footnote1;

If you have multiple lines in some of your footnote statements just make sure that the Footnote1 has the date piece.

Footnote2 through Footnote10 would not replace that part, just add additional lines.

acordes
Rhodochrosite | Level 12
I hadn't understood the footnotes' behavior

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1672 views
  • 3 likes
  • 4 in conversation