Hi,
I need to create one rtf output using proc report. There are two proc reports (part 1 and part 2) and I need to page break the two parts. Please help, thank you.
ods listing close;
ods rtf file = "test .rtf" ;title1='part 1'; proc report data = part1; columns ordx1 aebodsys total1 ;
define ordx1 / descending order order=internal noprint; define aebodsys / order order=internal noprint; define total1 / descending order order=internal noprint;
run;
title1='part 2'; proc report data = part2 ; columns ordx1 aebodsys total1 ;
define ordx1 / descending order order=internal noprint; define aebodsys / order order=internal noprint; define total1 / descending order order=internal noprint;
run;
ods rtf close;
ods listing;
ods listing close;ods rtf file = "C:\Users\My\Documents\test.rtf" ;
title1='part 1';
proc report data = sashelp.class;
where sex='M';
columns name sex height ;
run;
/*start in a new page;*/
ods startpage=yes;
title2='part 2';
proc report data = sashelp.class;
where sex='F';
columns name sex height ;
run;
ods rtf close;ods listing;
You need to clearly define what you mean by "page break the two parts". As in show an example of what the result looks like. You can make that manually with example columns and dummy data.
There are about a half-dozen ways I might interpret that phrase and almost certainly most if not all would not be what you want.
If at all practical it is a good idea to include data. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box opened using the </> icon or attached as text to show exactly what you have and that we can test code against.
ods listing close;ods rtf file = "C:\Users\My\Documents\test.rtf" ;
title1='part 1';
proc report data = sashelp.class;
where sex='M';
columns name sex height ;
run;
/*start in a new page;*/
ods startpage=yes;
title2='part 2';
proc report data = sashelp.class;
where sex='F';
columns name sex height ;
run;
ods rtf close;ods listing;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.