BookmarkSubscribeRSS Feed
Kastchei
Pyrite | Level 9
When using PROC REPORT with ODS PDF, is there an option to keep groups together, where possible on one page?

For instance, if I have a group with 10 rows, and it starts two rows from the bottom, I would like it to no print any of that group on the first page and instead start a fresh page for the group.

I've done this manually before by creating a noprint dummy variable to use 'break / page' with, but I am looking for a builtin method so that I don't have to massage the data each time I do this.

Thanks,
Michael
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
With the BREAK statement (to be used with an ORDER or GROUP item), you can use the PAGE option. That will ensure that every group starts on its own page.

For example, see the program below. There may be times when you need to set a dummy variable for page breaking. I find I usually need to do that when there's some arbitrary order or page breaking that I want to impose on a report. If you want to get the page breaking without the summary line, you'd could use this BREAK statement:
[pre]
BREAK AFTER REGION / PAGE;[/pre]

cynthia

options nodate number orientation=portrait;
ods listing close;

ods pdf file='c:\temp\Asia_Canada.pdf';

proc report data=sashelp.shoes nowd;
where region in ('Asia', 'Canada');
column region product subsidiary sales;
define region / group;
define product / group;
define subsidiary / order;
define sales /sum;
break after region / summarize page;
run;

ods pdf close;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 1387 views
  • 0 likes
  • 2 in conversation