BookmarkSubscribeRSS Feed
bonzybuddy
Calcite | Level 5

Hi there,

I am creating a pdf output file using PROC REPORT. in my code I am having two columns as ID which is going to be repeated on all the pages.

in my output, I am having 8 columns which can not fit into one horizontal page layout. So what I am doing is, I am keeping

4 columns on first page and rest 4 on second page using 'page' statement.

My problem is, I am having around 500 observations sometimes. So in PDF what happenes is, in first few pages all first 4 columns are

finished first and then pages for rest of the column starts.

For example, I have 500 obs and 8 columns. Then first 10 pages shows first 4 columns for all the obs and then rest 5-8 columns are printed

in next 10 pages.  But my requirement is to print first page page with 1-4 columns followed by page showing 5-8 columns.

I hope I have simplified enough the problem to understand better. Quick help is appreciated.

Thanks.

Message was edited by: bonzy buddy

4 REPLIES 4
ballardw
Super User

How are you generating the ouput? Proc Print, Report, Tabulate or something else? Different methods have different options.

bonzybuddy
Calcite | Level 5

Proc report

bonzybuddy
Calcite | Level 5

NO one!!!!

Tom
Super User Tom
Super User

I do not know of a good way.  You could try breaking the data into groups and using the group variable as a BY variable.  But predicting where would be a good place to split that would yield nice looking tables could be hard.  Here is an example using SASHELP.CARS.

ods pdf ;

ods listing close;

options nobyline ;

data cars;

  page=int( (_n_-1) / 25) ;

  set sashelp.cars (obs=50);

run;

proc report data=cars nofs missing;

  by page;

  define page / noprint ;

  define model / id ;

  define mpg_city / page ;

run;

options byline;

ods listing ;

ods pdf close;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1397 views
  • 3 likes
  • 3 in conversation