Problem Note 13577: WHERE clause returns incorrect results with overlapping ranges
The WHERE statement returns incorrect results when the WHERE clause
contains overlapping ranges. An overlapping range is when the WHERE
clause has multiple AND'd or OR'd conditions which an observation can
meet. For example, the following DATA step:
DATA CLASS;
SET SASHELP.CLASS;
WHERE ((AGE GE 11 AND AGE LE 12) OR
(AGE GE 15 AND AGE LE 16)) AND
(AGE GT 0) AND
(AGE LT 100);
RUN;
returns the incorrect number of observations.
To prevent the problem, change the last AND'd condition to:
...and age le 100;
or use a subsetting IF statement in place of the WHERE.
A Technical Support hot fix for Release 8.2 (TS2M0) for this
issue is available at:
http://www.sas.com/techsup/download/hotfix/82_sbcs_prod_list.html#013577
For customers running SAS with Asian Language Support (DBCS), this
hot fix should be downloaded from:
http://www.sas.com/techsup/download/hotfix/82_dbcs_prod_list.html#013577
A fix for SAS 9.1.3 (9.1 TS1M3) for this issue is available at:
http://www.sas.com/techsup/download/hotfix/e9_sbcs_prod_list.html#013577
For customers running SAS with Asian Language Support (DBCS), this
fix should be downloaded from:
http://www.sas.com/techsup/download/hotfix/e9_dbcs_prod_list.html#013577
Operating System and Release Information
| SAS System | Base SAS | Microsoft Windows 95/98 | 8.2 TS2M0 | |
| Microsoft Windows NT Workstation | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Microsoft Windows XP Professional | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Microsoft Windows Server 2003 Enterprise Edition | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Microsoft Windows Server 2003 Standard Edition | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Windows Millennium Edition (Me) | 8.2 TS2M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Microsoft Windows 2000 Professional | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Microsoft Windows 2000 Server | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Solaris | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| OpenVMS VAX | 8.2 TS2M0 | |
| IRIX | 8.2 TS2M0 | |
| 64-bit Enabled Solaris | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| Linux | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| OS/2 | 8.2 TS2M0 | |
| z/OS | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| ABI+ for Intel Architecture | 8.2 TS2M0 | |
| 64-bit Enabled HP-UX | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| 64-bit Enabled AIX | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| HP-UX | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| OpenVMS Alpha | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| CMS | 8.2 TS2M0 | |
| Tru64 UNIX | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
| AIX | 8.2 TS2M0 | 9.1 TS1M3 SP1 |
*
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: | Problem Note |
| Priority: | alert |
| Date Modified: | 2005-01-16 13:44:02 |
| Date Created: | 2004-10-11 15:42:09 |