SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 54652: Running an SQL query that contains the COUNT() function might result in incorrect results

DetailsHotfixAboutRate It

In Base SAS® software, incorrect results might occur when you run an SQL procedure query when the following conditions exist:

  • An SQL view is created from a DBMS table that is being accessed with a LIBNAME engine statement. The query to create the SQL view contains a function that is not passed down to the database.
  • A second SQL view is created that is a query of the first view. The query to create the second SQL view contains the DISTINCT argument and an ORDER BY clause, and it creates a new variable that is a constant value.
  • You have submitted an SQL query referencing the second view, where the query contains the COUNT summary function, and the argument to the function is the name of the constant variable that was created in the second view.

To work around this issue, either change the query such that one of the above conditions is not present, or create SAS data sets rather than SQL views.

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 SASz/OS9.2 TS2M39.4 TS1M3
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS2M3
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS2M3
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS2M3
Microsoft® Windows® for x649.2 TS2M39.4 TS1M3
Microsoft Windows Server 2003 Datacenter Edition9.2 TS2M3
Microsoft Windows Server 2003 Enterprise Edition9.2 TS2M3
Microsoft Windows Server 2003 Standard Edition9.2 TS2M3
Microsoft Windows Server 2003 for x649.2 TS2M3
Microsoft Windows Server 20089.2 TS2M39.4 TS1M3
Microsoft Windows Server 2008 R29.2 TS2M39.4 TS1M3
Microsoft Windows Server 2008 for x649.2 TS2M39.4 TS1M3
Microsoft Windows XP Professional9.2 TS2M3
Windows 7 Enterprise 32 bit9.2 TS2M39.4 TS1M3
Windows 7 Enterprise x649.2 TS2M39.4 TS1M3
Windows 7 Home Premium 32 bit9.2 TS2M39.4 TS1M3
Windows 7 Home Premium x649.2 TS2M39.4 TS1M3
Windows 7 Professional 32 bit9.2 TS2M39.4 TS1M3
Windows 7 Professional x649.2 TS2M39.4 TS1M3
Windows 7 Ultimate 32 bit9.2 TS2M39.4 TS1M3
Windows 7 Ultimate x649.2 TS2M39.4 TS1M3
Windows Vista9.2 TS2M3
Windows Vista for x649.2 TS2M3
64-bit Enabled AIX9.2 TS2M39.4 TS1M3
64-bit Enabled HP-UX9.2 TS2M39.4 TS1M3
64-bit Enabled Solaris9.2 TS2M39.4 TS1M3
HP-UX IPF9.2 TS2M39.4 TS1M3
Linux9.2 TS2M39.4 TS1M3
Linux for x649.2 TS2M39.4 TS1M3
OpenVMS on HP Integrity9.2 TS2M39.4 TS1M3
Solaris for x649.2 TS2M39.4 TS1M3
* 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.