SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 59557: Incorrect results occur when you subset a relational database management system table based on a date variable

DetailsHotfixAboutRate It

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

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASTru64 UNIX9.1 TS1M3 SP49.4 TS1M5
Solaris for x649.1 TS1M3 SP49.4 TS1M5
OpenVMS Alpha9.1 TS1M3 SP49.4 TS1M5
Linux on Itanium9.1 TS1M3 SP49.4 TS1M5
Linux for x649.1 TS1M3 SP49.4 TS1M5
Linux9.1 TS1M3 SP49.4 TS1M5
HP-UX IPF9.1 TS1M3 SP49.4 TS1M5
64-bit Enabled Solaris9.1 TS1M3 SP49.4 TS1M5
64-bit Enabled HP-UX9.1 TS1M3 SP49.4 TS1M5
64-bit Enabled AIX9.1 TS1M3 SP49.4 TS1M5
Windows Vista for x649.1 TS1M3 SP4
Windows Vista9.1 TS1M3 SP4
Microsoft Windows XP Professional9.1 TS1M3 SP4
Microsoft Windows Server 2003 Standard Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Enterprise Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Datacenter Edition9.1 TS1M3 SP4
Microsoft Windows NT Workstation9.1 TS1M3 SP4
Microsoft Windows 2000 Professional9.1 TS1M3 SP4
Microsoft Windows 2000 Server9.1 TS1M3 SP4
Microsoft Windows 2000 Datacenter Server9.1 TS1M3 SP4
Microsoft Windows 2000 Advanced Server9.1 TS1M3 SP4
Microsoft® Windows® for x649.1 TS1M3 SP49.4 TS1M5
Microsoft Windows XP 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.1 TS1M3 SP4
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.1 TS1M3 SP4
Microsoft® Windows® for 64-Bit Itanium-based Systems9.1 TS1M3 SP4
z/OS9.1 TS1M3 SP49.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.