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;
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.
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;
@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.
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 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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.