BookmarkSubscribeRSS Feed
jimspangler1955
Calcite | Level 5

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?

3 REPLIES 3
jwillis
Quartz | Level 8
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. 

jimspangler1955
Calcite | Level 5

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

Ksharp
Super User

You can put variable's names into the first obs in the table , and give it some style ,make it like a header .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 3 replies
  • 1070 views
  • 0 likes
  • 3 in conversation