I am trying to report a variable with very long content:
data test;
length text $32767.;
text=repeat('This is a piece of very looooong text',200);
run;
option nodate nonumber;
title;
ods rtf file='test.rtf' style=minimal;
proc report data=test;
run;
ods rtf close;
The report just look like this:
...
The content is too long to be showed in one page, so it takes break across pages.
When I open this RTF file in WORD software, I choose "Layout" → "Properties" → "Row", then check "Allow row to break across pages", the break just be removed:
...
How do you think about this? Can "Allow row to break across pages" be done with SAS?
If you are producing a Word document, consider using ODS WORD instead of RTF. The ODS WORD suboption CANT_SPLIT controls the "Allow row to break across pages" behavior:
data test;
length text $32767.;
text=repeat('This is a piece of very looooong text',200);
run;
option nodate nonumber;
title;
ods word file='test.docx' style=minimal options (CANT_SPLIT='OFF');
proc report data=test;
run;
ods word close;
Even in 9.4m8 ods word is pre-production, does anyone know when it will become fully usable?
ODS WORD is no longer pre-production in Viya LTS 2022.09.
One might ask just why you have so much text in Proc Report.
The procedure is designed to create grouped summary reports. That much text seems more appropriate for Proc Print, maybe.
Note that pagination is not a trivial topic when trying to dump large amounts of text into a table. The report table width, page size definition, ODS destination options, margins, font size as a minimum interact in determining where a "column" of a table would attempt to break.
Perhaps more a real use instead of one made up value would give us some clues for alternate approaches.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.