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";

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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