BookmarkSubscribeRSS Feed
xuqingsally
Calcite | Level 5

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
100.0%

0
0.0%

Place2

0
0.0%

1083
100.0%

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;

1 REPLY 1
ghosh
Barite | Level 11
*define an escape char;
ods escapechar='^';

* insert ^n for line breaks;
title " long  line ^n next line ^n another line";

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 884 views
  • 0 likes
  • 2 in conversation