If you want the report to fill the width of the output, it seems like it would be easier to use STYLE(REPORT)={OUTPUTWIDTH=100%} on the PROC REPORT statement.
The BODYTITLE_AUX option on the ODS RTF FILE statement might treat the title and the footnotes as you wish. I had to use a modified style template to show the title and footnotes without the bold italic, which is the default for RTF.
proc contents data=sashelp.cars varnum;
run;
proc print data=sashelp.cars (obs=10);
run;
data test__
(where=(roword<7) );
length grpord roword type1 brkvar 8;
set sashelp.cars
(drop=invoice) end=last;
retain grpord 1 brkvar 1;
array varc{*} $40 _character_;
array varn{*} 8 _numeric_;
array col {14} $40;
if _n_=1 then
do;
type1=1;
roword+1;
col1="Variable";
do i=2 to dim(col);
col{i}=" ";
end;
output;
end;
type1=0;
roword+1;
do i=1 to dim(varc);
col{i}=varc{i};
end;
do i=6 to dim(col);
col{i}=put(varn{i-1}, 10.);
end;
output;
keep grpord roword type1 brkvar col1-col14;
rename type1=type;
run;
proc template;
define style mod_rtf;
parent=styles.rtf;
style fonts from fonts/
'TitleFont2' = ("<serif>, Times Roman",12pt,bold italic)
'TitleFont' = ("<serif>, Times Roman",10pt)
'StrongFont' = ("<serif>, Times Roman",10pt,bold)
'EmphasisFont' = ("<serif>, Times Roman",10pt,italic)
'FixedEmphasisFont' = ("<monospace>, Courier",9pt,italic)
'FixedStrongFont' = ("<monospace>, Courier",9pt,bold)
'FixedHeadingFont' = ("<monospace>, Courier",9pt,bold)
'BatchFixedFont' = ("SAS Monospace, <monospace>, Courier",6.7pt)
'FixedFont' = ("<monospace>, Courier",9pt)
'headingEmphasisFont' = ("<serif>, Times Roman",11pt,bold italic)
'headingFont' = ("<serif>, Times Roman",11pt,bold)
'docFont' = ("<serif>, Times Roman",10pt);
end;
options nodate nonumber orientation=landscape;
*%let path=C:\Users\XXXX\Desktop;
%let path=/folders/myfolders/RTF;
ods rtf file="&path/ods_test.rtf" bodytitle_aux style=mod_rtf;
ods escapechar='~';
proc report data=test__ nowd split='`'
style(report)={outputwidth=100%};
column grpord roword type col1
("UYTEOAS"
("VV" col2) ("XX% UO" col3 col4 cia) ) ("ONIO CJIKLY"
("ZY" col5) ("XX% AB" col6 col7 cio) ) ("PJTYMNX"
("TN" col8) ("XX% AB" col9 col10 cip) ) ("LXRYNM"
("VS" col11) ("XX% AB" col12 col13 cil) ) ("~{raw \i Z}-jjjjj~{super a}" col14)
brkvar;
define grpord/order noprint;
define roword/order noprint;
define type/order noprint;
define brkvar/noprint;
define col1/ display " "
style(column)={just=l};
define col2/ display " "
style(column)={just=c};
define col3/ noprint " "
style(column)={just=c};
define col4/ noprint " "
style(column)={just=c};
define cia/ computed " "
style(column)={just=c};
define col5/ display " "
style(column)={just=c};
define col6/ noprint " "
style(column)={just=c};
define col7/ noprint " "
style(column)={just=c};
define cio/ computed " "
style(column)={just=c};
define col8/ display " "
style(column)={just=c};
define col9/ noprint " "
style(column)={just=c};
define col10/ noprint " "
style(column)={just=c};
define cip/ computed " "
style(column)={just=c};
define col11/ display " "
style(column)={just=c};
define col12/ noprint " "
style(column)={just=c};
define col13/ noprint " "
style(column)={just=c};
define cil/ computed " "
style(column)={just=c};
define col14/ display " "
style(column)={just=c};
compute brkvar;
if type=0 then
do;
call define('col1', 'style', 'style={leftmargin=12pt}');
end;
endcomp;
compute cia/character length=12;
if type=0 then
/*ci1=cats(col11,', ',col12);*/
cia=strip(col3)||', '||strip(col4);
else
ci1=" ";
endcomp;
compute cio/character length=12;
if type=0 then
/*ci2=cats(col16,', ',col17); */
cio=strip(col6)||', '||strip(col7);
else
ci2=" ";
endcomp;
compute cip/character length=12;
if type=0 then
/*ci1=cats(col11,', ',col12);*/
cip=strip(col9)||', '||strip(col10);
else
ci1=" ";
endcomp;
compute cil/character length=12;
if type=0 then
/*ci2=cats(col16,', ',col17); */
cil=strip(col12)||', '||strip(col13);
else
ci2=" ";
endcomp;
/* compute before _page_ / */
/* style={just=l foreground=black font_size=10pt bordertopstyle=hidden borderrightstyle=hidden borderleftstyle=hidden}; */
/* line "Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1"; */
/* endcomp; */
/* */
/* compute after / */
/* style={just=l foreground=black font_size=10pt borderbottomstyle=hidden borderrightstyle=hidden borderleftstyle=hidden}; */
/* line "footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote"; */
/* line "footnote line 2 footnote line 2 footnote line 2 footnote line 2 footnote line 2 footnote line 2 footnote line"; */
/* line "footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 foo"; */
/* endcomp; */
title j=l
"Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1 Title text 1";
footnote1 j=l
"footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote line 1 footnote";
footnote2 j=l
"footnote line 2 footnote line 2 footnote line 2 footnote line 2 footnote line 2 footnote line 2 footnote line";
footnote3 j=l
"footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 footnote line 3 foo";
run;
proc report data=test__ nowd split='`'
style(report)={outputwidth=100%};
column grpord roword type col1
("UYTEOAS"
("VV" col2) ("XX% UO" col3 col4 cia) ) ("ONIO CJIKLY"
("ZY" col5) ("XX% AB" col6 col7 cio) ) ("PJTYMNX"
("TN" col8) ("XX% AB" col9 col10 cip) ) ("LXRYNM"
("VS" col11) ("XX% AB" col12 col13 cil) ) ("~{raw \i Z}-jjjjj~{super a}" col14)
brkvar;
define grpord/order noprint;
define roword/order noprint;
define type/order noprint;
define brkvar/noprint;
define col1/ display " "
style(column)={just=l};
define col2/ display " "
style(column)={just=c};
define col3/ noprint " "
style(column)={just=c};
define col4/ noprint " "
style(column)={just=c};
define cia/ computed " "
style(column)={just=c};
define col5/ display " "
style(column)={just=c};
define col6/ noprint " "
style(column)={just=c};
define col7/ noprint " "
style(column)={just=c};
define cio/ computed " "
style(column)={just=c};
define col8/ display " "
style(column)={just=c};
define col9/ noprint " "
style(column)={just=c};
define col10/ noprint " "
style(column)={just=c};
define cip/ computed " "
style(column)={just=c};
define col11/ display " "
style(column)={just=c};
define col12/ noprint " "
style(column)={just=c};
define col13/ noprint " "
style(column)={just=c};
define cil/ computed " "
style(column)={just=c};
define col14/ display " "
style(column)={just=c};
compute brkvar;
if type=0 then
do;
call define('col1', 'style', 'style={leftmargin=12pt}');
end;
endcomp;
compute cia/character length=12;
if type=0 then
/*ci1=cats(col11,', ',col12);*/
cia=strip(col3)||', '||strip(col4);
else
ci1=" ";
endcomp;
compute cio/character length=12;
if type=0 then
/*ci2=cats(col16,', ',col17); */
cio=strip(col6)||', '||strip(col7);
else
ci2=" ";
endcomp;
compute cip/character length=12;
if type=0 then
/*ci1=cats(col11,', ',col12);*/
cip=strip(col9)||', '||strip(col10);
else
ci1=" ";
endcomp;
compute cil/character length=12;
if type=0 then
/*ci2=cats(col16,', ',col17); */
cil=strip(col12)||', '||strip(col13);
else
ci2=" ";
endcomp;
run;
ods rtf close;
Screen shot of results:
Titles and footnotes are near each table; each table fills width of page without spilling over to another page
... View more