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