Desktop productivity for business analysts and programmers

Column headers should not be repeated

Posts: 0

Column headers should not be repeated

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.
Posts: 8,716

Re: Column headers should not be repeated

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:
ods pdf file='xxx.pdf';

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

proc report data=lib.file(firstobs=38) nowd noheader;
ods pdf close;

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.

Posts: 0

Re: Column headers should not be repeated

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.
Frequent Contributor
Posts: 81

Re: Column headers should not be repeated


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

Posts: 0

Re: Column headers should not be repeated

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

Ask a Question
Discussion stats
  • 4 replies
  • 3 in conversation