BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
We are generating reports through proc report in SAS EG and we have a requirement in which we want column headers not to be repeated in all the pages.It should only be displayed on the first page.We dont want to use line statements since the output file is pdf.
So can you give me a solution.
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
Once you start PROC REPORT so it produces headers on page 1, it will produce headers on all subsequent pages. However, PROC REPORT does have the NOHEADER option. I'd consider trying something like this:
1) figure out how many observations will print on the first page, with the headers and then:
[pre]
ods pdf file='xxx.pdf';

proc report data=lib.file(obs=37) nowd;
run;

proc report data=lib.file(firstobs=38) nowd noheader;
run;
ods pdf close;
[/pre]

This will display up to and including obs 37 on the first PDF page and then the rest of the obs will display starting on the second page with the noheader option. This approach will work better with a detail report than with a summary report.

But, assuming you do have a detail report, this also gives you a chance to change titles between page 1 and the rest of the pages. Of course, depending on your font size, you may get more or less than 37 obs on the first page, so you'd have to adjust your code accordingly.

cynthia
deleted_user
Not applicable
Hi Cynthia,
Thanks a lot for your solution.
It works but the problem is that we have some detail list reports in which we have all character cols which has lot of description so we are not sure how many obs will fit in one page.
So we are having problem in these kind of report.
So pls if you have any other solution let me know.
prholland
Fluorite | Level 6
Sunil,

Why not run the whole report with NOHEADER, then add a single LINE statement containing the headers you require in an RBREAK BEFORE section?

..........Phil
deleted_user
Not applicable
Back in the days before Proc Report, this would have been a data step writing information with explicit PUT statements. The Option LinesLeft on the File statement would allow me to name a variable which would keep count of the number of lines remaining on a page.

My step would have named blocks of code so I could conditionally call up a footer, a header, a data first line section, or a data follow line section depending on my position on the page. I remember a little patience was needed to test my conditional statements, and often it would be the third or fourth attempt when I would find the right numbers to get the layout correct.

Kind regards

David

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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