I have a PROC PRINT BY xxx ID xxx that prints one set of column headers (per page) followed by the var lines grouped correctly in the SASLIST, but prints the column headers for every by group in the ODS RTF output. How can I get the ODS RTF to only print the column headers once per page similar to the SASLIST output?
Using the BY Statement with the NOBYLINE Option |
I don't see your code so I'm not sure if your issue is with ODS or PROC PRINT.
Base SAS(R) 9.2 Procedures Guide
If you use the BY statement with the SAS system option NOBYLINE, which suppresses the BY line that normally appears in output produced with BY-group processing, PROC PRINT always starts a new page for each BY group. This behavior ensures that if you create customized BY lines by putting BY-group information in the title and suppressing the default BY lines with NOBYLINE, the information in the titles matches the report on the pages.
I've never used a proc print with ODS RTF so I am curious to learn from your issue.
The code used to work correctly in SAS 9.2, but has performed differently using SAS 9.3. I do not want to have a new page for each BY Group using the NOBYLINE option.
PROC PRINT data=mydata;
BY key;
ID key;
Here is what I get based on output to SASLIST versus ODS RTF:
From SASLIST:
Heading-1 Heading-2 Heading-3
xxxxxxxxx xxxxxxxxx xxxxxxxx
xxxxxxxxx xxxxxxxxx xxxxxxxx
xxxxxxxxx xxxxxxxxx xxxxxxxx
xxxxxxxxx xxxxxxxxx xxxxxxxx
From ODS RTF:
Heading-1 Heading-2 Heading-3
xxxxxxxxx xxxxxxxxx xxxxxxxxxx
xxxxxxxxx xxxxxxxxx xxxxxxxxxx
Heading-1 Heading-2 Heading-3
xxxxxxxxx xxxxxxxxx xxxxxxxxxx
xxxxxxxxx xxxxxxxxx xxxxxxxxxx
You can put variable's names into the first obs in the table , and give it some style ,make it like a header .
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.