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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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