adam
adam

Reputation: 368

Forcing page breaks in proc report

I'm creating a 2-column report in SAS using PROC REPORT inside the ODS PDF statement.

My code looks something like this:

ods pdf file='/file/here.pdf' columns=2;
ods pagestart=now;

proc report data=rpt\_data nowd missing contents='';
columns a b c;
by a;
define a /group order=internal;
define b /display;
define c /display;

break after a /page;
run;

This only seems to "break" to the next column on the page, rather than an actual new page like I would like it to.

Any suggestions?

Running this code will produce the issue I'm inquiring about.

%let file1='/file/directory/test.pdf';

ods pdf file=&file1. columns=2;
ods pdf startpage=now;

proc sort data=sashelp.class out=temp;
by age;
run;
proc report data=temp nowd missing contents='';
columns age name sex;
by age;
define age /group order=internal;
define name /display;
define sex /display;

break after age /page;
run;
ods \_all\_ close;

Upvotes: 4

Views: 6266

Answers (2)

Lauren Samuels
Lauren Samuels

Reputation: 2529

This might not be practical in your case, but just in case: You can set page breaks if you use the ODS "Measured RTF" destination ; then you could convert your RTF file to a pdf...

Upvotes: 1

Chang Chung
Chang Chung

Reputation: 2307

As far as I know, this is not yet possible for the ods pdf destination as of 9.2. That is, without very ugly hacks like adding ghost rows to the short by-group and coloring them with the background color so that they are invisible on paper, and so on. SAS's technical support is quite responsive. I would call/email them before I give up, though. Hope this helps a bit.

Upvotes: 1

Related Questions