BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
3 REPLIES 3
Tim_SAS
Barite | Level 11
If you're using SAS 9.2, try the SPANROWS option on the PROC REPORT statement.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
Cynthia_sas
SAS Super FREQ
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]

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 697 views
  • 0 likes
  • 4 in conversation