Hi:
Using an ACROSS item would make a difference in the technique. There are 2 techniques to use as shown below:
1) Make 2 passes of PROC REPORT. Create an output dataset using ACROSS for the first pass and then use PROC REPORT on that output dataset -- labelling the absolute column numbers in this method may be cumbersome.;
OR
2) Use one PROC REPORT step and use COMPUTE blocks and the ALIAS technique to create a "dummy" item with the blank row headers filled in.
There are pros and cons to each method. Method 1 is simpler, but requires 2 PROC REPORT steps. Method 2 is more complex. It requires only 1 REPORT step, but is more advanced syntax. You have to decide which method suits your needs better. If you have the possibility of differing ACROSS values, from run to run then method 2 is the most flexible, as it does not require you to know the ACROSS values in advance.
cynthia
[pre]
** Example 1: Create Output dataset with ACROSS;
proc report data=sashelp.shoes nowd out=accout;
where region in ('Asia', 'Canada') and
product in ('Slipper', 'Sandal', 'Boot');
title '1a) Create output dataset with across and group usages';
column region subsidiary product,sales ;
define region / group noprint;
define subsidiary / group;
define product / across ;
define sales / sum 'Sales';
run;
** Final report based on output dataset from 1a;
proc report data=accout nowd;
title '1b) ACCOUT Data set';
column region subsidiary _c3_ _c4_ _c5_;
define region / display;
define subsidiary / display;
define _c3_ / sum 'Boot';
define _c4_ / sum 'Sandal';
define _c5_ / sum 'Slipper';
rbreak after /summarize;
compute after;
region = 'All Regions';
endcomp;
run;
** Example 2: Use Alias Technique in One PROC REPORT step;
proc report data=sashelp.shoes nowd;
where region in ('Asia', 'Canada') and
product in ('Slipper', 'Sandal', 'Boot');
title '2) Use Alias Technique and Computed Items';
column region showreg subsidiary sales,product ;
define region / group noprint;
define showreg / computed;
define subsidiary / group;
define product / across ;
define sales / sum 'Sales';
rbreak after / summarize;
compute before region;
holdreg = region;
endcomp;
compute showreg / character length=25;
showreg = holdreg;
if _break_ = '_RBREAK_' then showreg = 'All Regions';
endcomp;
run;
[/pre]