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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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