Usage Note 24543: How can I prevent my GROUP or ORDER variables from repeating when previous GROUP or ORDER values are shown?
A GROUP or ORDER variable will repeat its value when there is a GROUP or ORDER variable to the left with a shown value.
A workaround to the default behavior of PROC REPORT would be to create an IF
condition in a compute block that uses the LAG function to compare the previous value to the current value. If the condition is true, then the current value is set to blank or missing.
Here is an example of this technique:
OPTIONS MISSING=' ';
PROC REPORT NOWD DATA=sashelp.class;
COL name age sex ;
DEFINE name / GROUP ORDER=DATA;
DEFINE age / GROUP ORDER=DATA;
DEFINE sex / GROUP ORDER=DATA;
COMPUTE sex;
IF LAG(age)=age THEN age=.;
IF LAG(sex)=sex THEN sex=' ';
ENDCOMP;
RUN;
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | low |
Topic: | SAS Reference ==> Procedures ==> REPORT
|
Date Modified: | 2007-12-17 10:20:18 |
Date Created: | 2006-09-11 16:56:11 |