Thursday, June 3, 2010

How to identify the header of ACROSS columns in PROC Report

When one across item is used with >1 analysis items, the header text of the across item will affect all. To use different header text, we have to specify an alias for the across item.
Below are the sample codes:

* Default;
proc report data=sashelp.class nowd;
column sex,height sex,weight;
define sex / across;
define height / analysis mean;
define weight / analysis mean;
run;

* To use alias for the across item;
proc report data=sashelp.class nowd;
column sex,height (sex=sex_alias),weight;
define sex / across "Height";
define sex_alias / across "Weight";
define height / analysis mean " ";
define weight / analysis mean " ";
run;