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.
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):
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 ' ';
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 ;
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.
punctuation helps, even when late ;-) Message was edited by: Peter.C