BookmarkSubscribeRSS Feed
Pavan_SAS
SAS Employee
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?
4 REPLIES 4
Tim_SAS
Barite | Level 11
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
Pavan_SAS
SAS Employee
i want to print "f,g,h" also, after printing all a,b,c,d,e variables.
Cynthia_sas
SAS Super FREQ
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]

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1436 views
  • 0 likes
  • 4 in conversation