Hi, when I define the header in proc template, the header is too long so that the table was expanded to a wide one which split into two tables in RTF output. How can I wrap the header and let it not become two tables?
My header is very very very very very very very very very very very very very very very very very very long | ||
| Place1 | Place2 |
Place1 | 921 | 0 |
Place2 | 0 | 1083 |
Total | 921 | 1083 |
My header is very very very very very very very very very very very very very very very very very very long | |
| Total |
Place1 | 921 |
Place2 | 1083 |
Total | 2004 |
The code I used:
proc format;
picture pctfmt (round) other ='009.9%';
run;
proc template;
define crosstabs Base.Freq.CrossTabFreqs;
cellvalue frequency colpercent;
header Myheader;
style= {cellwidth = 6in};
define header Myheader;
text 'My header is very very very very very very very very very very very very very very very very very very long';
style= header;
end;
define frequency;
format =8.;
end;
define colpercent;
format=pctfmt.;
end;
end;
run;
ods listing close; ods rtf file="example.rtf";
ods noproctitle;
proc freq data = example;
tables _all_*site/missing nocum norow nopercent;
run;
ods rtf close; ods listing;
*define an escape char;
ods escapechar='^';
* insert ^n for line breaks;
title " long line ^n next line ^n another line";
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.