The SAS Output Delivery System and reporting techniques

Repeating Information at the top of the page

Reply
N/A
Posts: 0

Repeating Information at the top of the page

Using Proc Report I have several define statements that use the order parameter to supress additional occurances of the data. However, at the top of each page I would like to see this data displayed.

Is there a way to do this? In some cases, I page break on specific variable; in other cases the report just flows.
Super Contributor
Posts: 394

Re: Repeating Information at the top of the page

If you're using SAS 9.2, try the SPANROWS option on the PROC REPORT statement.
Super Contributor
Super Contributor
Posts: 3,174

Re: Repeating Information at the top of the page

A search against the SAS.COM support site yielded the note below:

http://support.sas.com/kb/7/887.html
Problem Note 7887: PROC REPORT does not repeat values of GROUP/ORDER variables when groups break across pages

Scott Barry
SBBWorks, Inc.

P.S. Google advanced search argument for consideration:

proc report order variable page heading site:sas.com
SAS Super FREQ
Posts: 8,743

Re: Repeating Information at the top of the page

Hi:
In addition to the suggestions made by Tim and Scott, I wonder what you mean by "at the top of the page" --perhaps want to use COMPUTE BEFORE _PAGE_ with a LINE statment???? Or do you want to use BY group processing with #BYVAL, #BYVAR???

The program below illustrates both of these techniques using both ODS RTF and ODS TAGSETS.RTF for SAS 9.2.

cynthia

[pre]
** 1) Use COMPUTE blocks;
ods tagsets.rtf file='c:\temp\comp_bef_ts.rtf';
ods rtf file='c:\temp\comp_bef_orig.rtf';

proc report data=sashelp.shoes nowd;
title '1) Compare COMPUTE BEFORE _PAGE_ with COMPUTE BEFORE';
column region subsidiary product sales inventory returns;
where region in ('Africa', 'Asia');
define region / group page noprint;
define subsidiary /group;
define product / group;
break after region / summarize;
compute after region;
line ' ';
endcomp;
compute before _page_ / style={just=l background=pink};
length txtline $100;
txtline = '1/Region is: '||trim(region);
line txtline $char100.;
endcomp;
compute before region/ style={just=l background=lightblue};
length txtline2 $100;
txtline2 = '2/Region is: '||trim(region);
line txtline2 $char100.;
endcomp;
run;
title;

ods _all_ close;

** 2) Use #BYVAR/#BYVAL;
ods tagsets.rtf file='c:\temp\title_byline_ts.rtf';
ods rtf file='c:\temp\title_byline_orig.rtf';

options nobyline;
proc sort data=sashelp.shoes out=shoes;
by region;
where region in ('Africa', 'Asia');
run;

proc report data=shoes nowd;
title '2) Use Title Options Along with COMPUTE _BEFORE_ PAGE -- decide which you want';
title2 '#BYVAR1: #BYVAL1';
by region;
column region subsidiary product sales inventory returns;
define region / group noprint;
define subsidiary /group;
define product / group;
break after region / summarize;
compute after region;
line ' ';
endcomp;
compute before _page_ / style={just=l background=pink};
length txtline $100;
txtline = '1/Region is: '||trim(region);
line txtline $char100.;
endcomp;
compute before region/ style={just=l background=lightblue};
length txtline2 $100;
txtline2 = '2/Region is: '||trim(region);
line txtline2 $char100.;
endcomp;
run;
title;
options byline;
ods _all_ close;
[/pre]
Ask a Question
Discussion stats
  • 3 replies
  • 153 views
  • 0 likes
  • 4 in conversation