The SAS Output Delivery System and reporting techniques

proc report - page break

Reply
SAS Employee
Posts: 73

proc report - page break

i am having a,b,c,d,e,f,g,h variables and 100 observations. By default with proc report i am getting a,b,c,d,e variables and 1st 20 observations in page1 and remaining f,g,h variables and 1st 20 observations in page2. next 20 observations and a,b,c,d,e variables in page3 and so on......

But i want to print(with proc report) a,b,c,d,e variables and 1st 20 observations in page1; a,b,c,d,e variables and next 20 observations in page2; a,b,c,d,e variables and next 20 observations in page3 and so on....

how i can achieve this?
Super Contributor
Posts: 394

Re: proc report - page break

Probably you can't. PROC REPORT has pretty firm ideas about paneling and no options to change it. If I had to do this, I'd use two reports, the first with a, b, c, d, and e columns, and the 2nd with f, g, and h columns.
Super Contributor
Super Contributor
Posts: 3,174

Re: proc report - page break

From your post, it seems to me that you need only to omit those additional unwanted SAS variables "f, g, h" from your PROC REPORT code - maybe I misunderstood.

Scott Barry
SBBWorks, Inc.
SAS Employee
Posts: 73

Re: proc report - page break

i want to print "f,g,h" also, after printing all a,b,c,d,e variables.
SAS Super FREQ
Posts: 8,743

Re: proc report - page break

Hi:
If you are using the RTF or PDF destinations, then you can change your orientation system option to Landscape, which may fit all the variables on one page. Otherwise, you may need to make two passes thru the data to get your report the ways you want. For example, in the program at the end of this post, in Step 1, there are 2 passes thru SASHELP.SHOES and in Step 2, the orientation has been changed to landscape orientation.

cynthia
[pre]
data shoes;
set sashelp.shoes;
Thisobs = _n_;
run;

**1) Make 2 passes thru the data;
options orientation=portrait;

ods rtf file='twopass.rtf' ;
ods pdf file='twopass.pdf';

proc report data=shoes nowd;
title 'Some variables';
column Thisobs region product subsidiary sales;
run;

proc report data=shoes nowd;
title 'The rest of the variables (repeat thisobs and region for ID purposes)';
column Thisobs region inventory returns stores;
run;

ods _all_ close;

**2) Use Landscape orientation;
option orientation=landscape;

ods rtf file='useland.rtf' ;
ods pdf file='useland.pdf';

proc report data=sashelp.shoes nowd;
title 'Use Landscape Orientation to Display All Columns';
column region product subsidiary sales inventory returns stores;
run;
ods _all_ close;
[/pre]
Ask a Question
Discussion stats
  • 4 replies
  • 222 views
  • 0 likes
  • 4 in conversation