Hi, Wow, that's a pretty code ! To answer to your questions: 1) Why is footnote line broken and displayed as 2 lines ? This is the default footnote and It is actually one line, but from client SOP, we had to display this default footnote as : the "first" part of the default footnote is the "Source Data : Listings^nL_[...].sas" left justified, then it is added to "Data Version[...]" center justification, and finally Table name with date and time of run plus the page number over all pages "T_[...].sas DDMMMYYYY hh:mm x/y". This footnote is "footnote1" After that default footnote, we has as many footnotes as necessary with a limit of 10, starting from footnote2. 3) Is the footnote the same that should be in production ? The production footnote is the same, yes. This is for tables. For listing, the "Source Data" part is removed. For the tables, we use: %let SList = Source Data: Listings %sysfunc(Strip(&Source_Listing));
%let foot1 = j=l "&SList" j=c "Data Version: &dataver, &datadate " j=r " &prog_name..sas &runTime ^{thispage}/^{lastpage}";
footnote1 &foot1. ; For the listings, we use: %let foot1 = j=c "Data Version: &dataver, &datadate " j=r " &prog_name..sas &runTime ^{thispage}/^{lastpage}";
footnote1 &foot1. ; Then we add the rest of the footnotes, with a loop, to set footnote2 to footnote10 if relevant. I still wonder if the missing page number has something to do with the template ? I don't see anything wrong. %MACRO set_ods_rtf(outPath=,tfl_name=,adDsn=, Source_Listing=, option=bodytitle, startpage=YES); ods path(prepend) work.templat(update);
proc template ;
define style newstyle ;
parent = styles.journal ;
class Parskip /
font = fonts("headingFont")
cellpadding = 0 cellspacing = 0 /* Only for Measured */
frame= void
Rules = NONE
BorderWidth = 0
Color = _undef_
BackGroundColor = _undef_;
style byline / font_face="Courier New" font_style=Roman background = white;
style Body from Document / font_face="Courier New" font_style=Roman background = white;
style data / font_face="Courier New" font_style=Roman ;
style table / font_face="Courier New" font_style=Roman
bordercolor=black background = white borderwidth=1 ;
style cellcontents / font_face="Courier New" font_style=Roman ;
style TitleAndNoteContainer / font_face="Courier New" font_style=Roman background = white;
style ProcTitle / font_face="Courier New" font_style=Roman ;
style systemtitle / font_face="Courier New" font_style=Roman ;
style rowheader from headersandfooters / font_face="Courier New" font_style=Roman ;
style BodyDate / font_face="Courier New" font_style=Roman ;
style PageNo / font_face="Courier New" font_style=Roman ;
style SysTitleAndFooterContainer / font_face="Courier New" font_style=Roman ;
style header from headersandfooters / font_face="Courier New" font_style=Roman background = white;
style SystemFooter / font_face="Courier New" font_style=Roman bordercolor=black background = white borderwidth=1 ;
style NoteContent / font_face="Courier New" font_style=Roman font_size=8pt;
end;
run ;
/*** Set ODS Environment ***/
options papersize=letter leftmargin=3.65cm rightmargin=2.11cm topmargin=3.36cm bottommargin=3.3cm orientation=landscape;
%if %qupcase(%superq(option))=%quote(TAGSETS) %then %do;
ods tagsets.rtf file="&outPath.\&tfl_name..rtf" options(vspace='no') options(continue_tag="no") startpage=&startpage.;
ods tagsets.rtf style=newstyle ;
%end; %else %do;
ods rtf file="&outPath.\&tfl_name..rtf" &option startpage=&startpage.;
ods rtf style=newstyle ;
%end;
options nonumber nocenter nobyline nodate formdlim='' formchar="|_---|+|---+=|-/\<>*" MISSING=" " ;
ods escapechar='^' ; %mend; Another workaround was to use a macro i build with a colleague sometimes ago to force a page break after a certain number of lines, which ultimately gave us also a theoretical page number, it worked for a time. But it is not flawless... Thanks a lot! I'm gonna read the code and test it right away. I'll let you know 🙂
... View more