Hi
I am trying to generate following output, I have tried various ways but no luck. Could you please help me out how to move the highlighted table to second page.
Getting:
The highlighted in yellow color table should be moved to second page with separate title 'All'
This is my code.
proc template;
define style styles.tabstyle;
parent=styles.rtf;
style table from table /
cellpadding = 1pt;
style body from body /
leftmargin=1in
rightmargin=1in
topmargin=1.2in
bottommargin=1in;
style header from header /
frame=void
rules=groups
font_weight=medium
bordertopstyle=solid bordertopwidth=0.1px bordertopcolor=black
borderbottomstyle=solid borderbottomwidth=0.1px borderbottomcolor=black;
end;
run;
title;
footnote;
goptions reset=all;
options orientation=&lineop_ missing='';
ods noresults;
ods listing close;
ods rtf file="C:\Local\chk.rtf" notoc_data style=styles.tabstyle startpage=no ;
ods escapechar="^";
title1 j=left f=timesnewroman h=10pt "XYX";
title3 j=left "Grades and Sports";
proc print data=a width=full label split='~' style(table)=[vjust=middle just=center]
style(header)=[font_size=10pt font_weight=medium just=center]
style(column)=[font_size=10pt font_weight=medium just=left] noobs;
var Name Science Mathematics History Geography;
run;
title;
footnote;
proc print data=b width=full label split='~' style(table)=[vjust=middle just=center]
style(header)=[font_size=10pt font_weight=medium just=center]
style(column)=[font_size=10pt font_weight=medium just=left] noobs;
var Name Tennis Baseball Basketball Hockey Football;
run;
title3 j=left f=timesnewroman h=10pt "All";
proc print data = c width=full label split='~' style(table)=[vjust=middle just=center]
style(header)=[font_size=10pt font_weight=medium just=center]
style(column)=[font_size=10pt font_weight=medium just=left] noobs;
var Rank Name Tennis Baseball Basketball Hockey Science Mathematics History Geography;
run;
ods _all_ close;
ods listing;
ods noresults;
Prior to the third proc print, issue an
ods startpage=now;
statement.
Almost there. You can use ODS RTF, or other destinations, without providing a file to modify ODS options like the startpage setting in the middle of the document.
ods rtf file="C:\Local\chk.rtf" notoc_data style=styles.tabstyle startpage=no ; ods escapechar="^"; title1 j=left f=timesnewroman h=10pt "XYX"; title3 j=left "Grades and Sports"; proc print data=a width=full label split='~' style(table)=[vjust=middle just=center] style(header)=[font_size=10pt font_weight=medium just=center] style(column)=[font_size=10pt font_weight=medium just=left] noobs; var Name Science Mathematics History Geography; run; title; footnote; proc print data=b width=full label split='~' style(table)=[vjust=middle just=center] style(header)=[font_size=10pt font_weight=medium just=center] style(column)=[font_size=10pt font_weight=medium just=left] noobs; var Name Tennis Baseball Basketball Hockey Football; run; ods rtf startpage=NOW; title3 j=left f=timesnewroman h=10pt "All"; proc print data = c width=full label split='~' style(table)=[vjust=middle just=center] style(header)=[font_size=10pt font_weight=medium just=center] style(column)=[font_size=10pt font_weight=medium just=left] noobs; var Rank Name Tennis Baseball Basketball Hockey Science Mathematics History Geography; run; ods rtf close;
Prior to the third proc print, issue an
ods startpage=now;
statement.
Calling all data scientists and open-source enthusiasts! Want to solve real problems that impact your company or the world? Register to hack by August 31st!
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.