Problem Note 49090: MULTILABEL format with identical ranges gives unexpected results in procedures MEANS, SUMMARY, TABULATE, and REPORT
Multilabel formats can be applied to procedures that support the summary object, including MEANS, SUMMARY, TABULATE, and REPORT. If PROC FORMAT is used to create a multilabel format and the ranges are identical, incorrect results might be generated. When the ranges are the same, multiple labels are chained together and any distinguishing exclusion indicators are ignored. In the sample below, 15<-100 and 15-100 are considered the same range when they are not.
proc format;
value fmtname (multilabel)
10<-15 = '10-15'
15<-100 = '16-20'
15-99 = 'G1'
15-100 = 'G2';
run;
The current work-around is to add the NOTSORTED option to the PROC FORMAT step.
value fmtname (multilabel notsorted)
See the Full Code and Output tabs for sample code and output.
Operating System and Release Information
SAS System | Base SAS | OpenVMS VAX | 8.1 TS1M0 | 9.4 TS1M0 |
z/OS | 8.1 TS1M0 | 9.4 TS1M0 |
OS/2 | 8.1 TS1M0 | |
Microsoft Windows 95/98 | 8.1 TS1M0 | |
Microsoft Windows 2000 Advanced Server | 8.1 TS1M0 | |
Microsoft Windows 2000 Datacenter Server | 8.1 TS1M0 | |
Microsoft Windows 2000 Server | 8.1 TS1M0 | |
Microsoft Windows 2000 Professional | 8.1 TS1M0 | |
Microsoft Windows NT Workstation | 8.1 TS1M0 | |
Microsoft Windows XP Professional | 8.1 TS1M0 | 9.4 TS1M0 |
Windows Millennium Edition (Me) | 8.1 TS1M0 | |
ABI+ for Intel Architecture | 8.1 TS1M0 | 9.4 TS1M0 |
AIX | 8.1 TS1M0 | 9.4 TS1M0 |
HP-UX | 8.1 TS1M0 | 9.4 TS1M0 |
IRIX | 8.1 TS1M0 | 9.4 TS1M0 |
OpenVMS Alpha | 8.1 TS1M0 | 9.4 TS1M0 |
Solaris | 8.1 TS1M0 | 9.4 TS1M0 |
Tru64 UNIX | 8.1 TS1M0 | 9.4 TS1M0 |
*
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.
proc format;
value FMTName (multilabel)
10<-15 = "10-15"
15<-100 = "16-20"
15-99 ="G1"
15-100 ="G2";
run;
proc summary data=sashelp.class nway;
class age / mlf;
output out=new;
format age fmtname.;
run;
proc print data=new;
title 'Using MULTILABEL without NOTSORTED';
run;
proc format;
value FMTName (multilabel notsorted)
10<-15 = "10-15"
15<-100 = "16-20"
15-99 ="G1"
15-100 ="G2";
run;
proc summary data=sashelp.class nway;
class age / mlf;
output out=new;
format age fmtname.;
run;
proc print data=new;
title 'Using MULTILABEL with NOTSORTED';
run;
Using MULTILABEL without NOTSORTED
Obs Age _TYPE_ _FREQ_
1 10-15 1 18
2 16-20 1 1
3 G1 1 5
4 G2 1 1 <====incorrect
Using MULTILABEL with NOTSORTED
Obs Age _TYPE_ _FREQ_
1 10-15 1 18
2 16-20 1 1
3 G1 1 5
4 G2 1 5
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2013-03-06 11:56:22 |
Date Created: | 2013-02-07 13:36:40 |