Problem Note 59557: Incorrect results occur when you subset a relational database management system table based on a date variable
When you subset a relational database management system (DBMS) table by a date variable, incorrect results might occur. The problem occurs when the following conditions are true:
- A date variable is compared to a SAS® missing value.
- A date variable is compared to an internal SAS date value using a less-than or a less-than-or-equal-to comparison.
The following example code illustrates a WHERE statement that produces incorrect results:
where (dt1 = . or dt1 <= 20454)
There are two workarounds. One is to use the IS NULL operator rather than a SAS missing value, as shown below:
where (dt1 is null or dt1 <= 20454)
The second workaround is to use a SAS date constant, as shown below:
where (dt1 = . or dt1 <= "01JAN2016"d)
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | Base SAS | Tru64 UNIX | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
Solaris for x64 | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
OpenVMS Alpha | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
Linux on Itanium | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
Linux for x64 | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
Linux | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
HP-UX IPF | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
64-bit Enabled Solaris | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
64-bit Enabled AIX | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
Windows Vista for x64 | 9.1 TS1M3 SP4 | |
Windows Vista | 9.1 TS1M3 SP4 | |
Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |
Microsoft® Windows® for x64 | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |
z/OS | 9.1 TS1M3 SP4 | 9.4 TS1M5 |
*
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: | 2017-03-08 09:42:41 |
Date Created: | 2016-12-19 10:37:43 |