The SAS Output Delivery System and reporting techniques

ODS PDF page formatting

Reply
Contributor
Posts: 28

ODS PDF page formatting

In 9.1.3 is there an proc report option to control the page formatting in PDF so that a new page isnt thrown that splits a set of records across 2 pages?

So for example if I have a dataset with 50 columns and 20 rows:

-     currently the output is split across 2 pages such that all 20 rows and columns 1-25 are on page one, and, all 20 rows and columns 26-50 are on the second page.

-     I would like to see two pages but with rows 1-10 and all columns on the first page (maybe split across 2 tables) and rows 11- 20 rows and all columns on the second page. (So the rows are present on a single page.)

I hope that make sense.

Grand Advisor
Posts: 10,239

Re: ODS PDF page formatting

You may need to change how you are currently creating your output. Since you don't mention how you are generating output, Proc Print, Proc Report, Proc Tabulate, ODS FILE Print or statistical procedure it is hard to recommend ideas as each one has options that might work.


Contributor
Posts: 28

Re: ODS PDF page formatting

Hi ballardw. I did mention proc report in my question and that is what I'm using to create the PDF output. Looking around the forum here I see that there may not be an answer to my question but any guidance would be great.

Thanks.

Grand Advisor
Posts: 10,239

Re: ODS PDF page formatting

The closest I can come requires that the data be preprocessed. The following code does what I think you are looking for. However if your variable names or lengths of output are any longer than I'm showing then you will get another block of variables. I find that I don't like FILE PRINT ODS as you don't have much control, hence the keep variables and the order in the data set is the output order. The ODS Style is controlling fontsize. If a style with a larger font is used then the lines are longer and PDF will break the columns yet again.

My example has an ID variable so you can connect the separate lines of the same observation.

data junk;
   do id = 1 to 20;
      Array x x1-x48;

      do j=1 to dim(x);
         x= ranuni(237);
      end;
      output;
   end;
   drop j;
   format x1-x50 f5.4;
run;  
ods pdf file="d:\data\part1.pdf" style=meadow startpage=no;
data _null_;
   set junk (obs=10 keep=id x1-x24);
   file print ods;
   put  id x1-x24;
run;
data _null_;
   set junk (obs=10 keep=id x25-x48);
   file print ods;
   put  id x25-x48 ;
run;
ods pdf startpage=now;
data _null_;
   set junk (firstobs=11 obs=20 keep=id x1-x24);
   file print ods;
   put  id x1-x24;
run;
data _null_;
   set junk (firstobs=11 obs=20keep=id x25-x48);
   file print ods;
   put  id x25-x48 ;
run;
ods pdf close;

Ask a Question
Discussion stats
  • 3 replies
  • 242 views
  • 0 likes
  • 2 in conversation