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]