Problem Note 54652: Running an SQL query that contains the COUNT() function might result in incorrect results
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
SAS System | Base SAS | z/OS | 9.2 TS2M3 | 9.4 TS1M3 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M3 | |
Microsoft® Windows® for x64 | 9.2 TS2M3 | 9.4 TS1M3 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M3 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M3 | |
Microsoft Windows Server 2008 | 9.2 TS2M3 | 9.4 TS1M3 |
Microsoft Windows Server 2008 R2 | 9.2 TS2M3 | 9.4 TS1M3 |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M3 | 9.4 TS1M3 |
Microsoft Windows XP Professional | 9.2 TS2M3 | |
Windows 7 Enterprise 32 bit | 9.2 TS2M3 | 9.4 TS1M3 |
Windows 7 Enterprise x64 | 9.2 TS2M3 | 9.4 TS1M3 |
Windows 7 Home Premium 32 bit | 9.2 TS2M3 | 9.4 TS1M3 |
Windows 7 Home Premium x64 | 9.2 TS2M3 | 9.4 TS1M3 |
Windows 7 Professional 32 bit | 9.2 TS2M3 | 9.4 TS1M3 |
Windows 7 Professional x64 | 9.2 TS2M3 | 9.4 TS1M3 |
Windows 7 Ultimate 32 bit | 9.2 TS2M3 | 9.4 TS1M3 |
Windows 7 Ultimate x64 | 9.2 TS2M3 | 9.4 TS1M3 |
Windows Vista | 9.2 TS2M3 | |
Windows Vista for x64 | 9.2 TS2M3 | |
64-bit Enabled AIX | 9.2 TS2M3 | 9.4 TS1M3 |
64-bit Enabled HP-UX | 9.2 TS2M3 | 9.4 TS1M3 |
64-bit Enabled Solaris | 9.2 TS2M3 | 9.4 TS1M3 |
HP-UX IPF | 9.2 TS2M3 | 9.4 TS1M3 |
Linux | 9.2 TS2M3 | 9.4 TS1M3 |
Linux for x64 | 9.2 TS2M3 | 9.4 TS1M3 |
OpenVMS on HP Integrity | 9.2 TS2M3 | 9.4 TS1M3 |
Solaris for x64 | 9.2 TS2M3 | 9.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.
Type: | Problem Note |
Priority: | alert |
Date Modified: | 2015-07-15 11:39:19 |
Date Created: | 2014-11-17 15:53:50 |