The SAS Output Delivery System and reporting techniques

Suppress Page Break for the BY Variable ODS PDF

Reply
Contributor
Posts: 33

Suppress Page Break for the BY Variable ODS PDF

Hi,

I have a sorted dataset and am using the sorted fields in the #byval1-6 in the title, All the variables in the BYVAL are same except variable 6 which sometimes changes. I have approx 10 records and would like to print them in the single page by just adding a blank line if the value of the BY variable changes instead of going to the next page.

Version: SAS 9.1.3
OS : AIX
ODS PDF

Regards
Russell
Super Contributor
Super Contributor
Posts: 3,174

Re: Suppress Page Break for the BY Variable ODS PDF

Posted in reply to RussellAlmeida
My initial response is to suggest that you have total control with DATA step report generation.

Scott Barry
SBBWorks, Inc.


Google advanced search argument to consider using:

data step programming report site:sas.com
SAS Super FREQ
Posts: 8,864

Re: Suppress Page Break for the BY Variable ODS PDF

Posted in reply to RussellAlmeida
Hi:
In addition to Scott's suggestion, PROC REPORT allows you to do something similar to BY processing via the use of BREAK processing on GROUP or ORDER variables. You can have a LINE statement write out a blank line when the value of a GROUP or ORDER variable (similar to your BY variable) changes.

The syntax would be something like (note untested code...not at my computer):
[pre]
ods pdf file='c:\temp\testbr.pdf';

proc report data=sashelp.class nowd;
title 'List of Students and Averages for Age, Height and Weight by Gender';
column sex name age height weight;
define sex / order;
define name / order;
define age / mean;
define height / mean;
define weight / mean;
break after sex / summarize;
compute after sex;
line ' ';
end;
run;

ods pdf close;
[/pre]

cynthia
Valued Guide
Posts: 2,177

Re: Suppress Page Break for the BY Variable ODS PDF

Posted in reply to RussellAlmeida
Russel

have you seen the layout PROC PRINT provides when the ID variable list starts with all the BY variables?
For example[pre]proc sort data= sashelp.class(obs=6) out= class ;
by sex age ;
run ;
proc print ;
by sex ;
id sex age ;
var name height ;
run ;[/pre]The procedure inserts a blank line before each by-group[pre]The SAS System

Sex Age Name Height

F 13 Alice 56.5
13 Barbara 65.3
14 Carol 62.8

M 12 James 57.3
14 Alfred 69.0
14 Henry 63.5
[/pre]There are your blank lines between by-groups.
In the PDF destination you still get page breaks while you use the NOBYLINE option. I hope with this style of ID/BY combination you might feel comfortable using PROC PRINT without the NOBYLINE option.

PeterC punctuation helps, even when late ;-) Message was edited by: Peter.C
Super Contributor
Super Contributor
Posts: 3,174

Re: Suppress Page Break for the BY Variable ODS PDF

Here's a conference paper demonstrating how a PROC REPORT output can be customized and then generated with a DATA _NULL_ step:

http://www2.sas.com/proceedings/sugi25/25/ad/25p032.pdf

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search for this topic:

proc report customized pagination site:sas.com
Ask a Question
Discussion stats
  • 4 replies
  • 313 views
  • 0 likes
  • 4 in conversation