Problem Note 67011: A query that is passed to the database might include an incorrect variable name in the GROUP BY clause
An incorrect query might be passed to the database, which results in the query taking longer to execute. This issue can occur when all of the following are true:
- A view is created in which the query includes a GROUP BY clause and a variable that appeared on the GROUP BY clause is also renamed in the SELECT clause.
- The query joins that view with either another table in the database or a view that references a table in the database.
In this scenario, instead of passing the original variable name in the GROUP BY clause, SAS passes the renamed name. This behavior results in an error with wording that varies depending on the database and can include the following phrases:
- does not exist
- is not valid in the context where it is used
- invalid identifier
The error occurs because the database expects the original variable name in the GROUP BY clause. You see the error when you set the SASTRACE= option. SAS, rather than failing, changes the query that it submits to the database to a valid query. This behavior can result in more of the processing occurring in SAS and slower performance than if the database had processed the entire query.
The only workaround is to not rename the variable in the view and rename it in the second query.
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.4_M5 | | 9.4 TS1M5 | |
z/OS 64-bit | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft® Windows® for x64 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8 Enterprise 32-bit | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8 Enterprise x64 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8 Pro 32-bit | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8 Pro x64 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 8.1 Pro x64 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows 10 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2008 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2008 R2 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2008 for x64 | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2012 Datacenter | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2012 R2 Std | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2012 Std | 9.4_M5 | | 9.4 TS1M5 | |
Microsoft Windows Server 2016 | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Enterprise 32 bit | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Enterprise x64 | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Home Premium 32 bit | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Home Premium x64 | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Professional 32 bit | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Professional x64 | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Ultimate 32 bit | 9.4_M5 | | 9.4 TS1M5 | |
Windows 7 Ultimate x64 | 9.4_M5 | | 9.4 TS1M5 | |
64-bit Enabled AIX | 9.4_M5 | | 9.4 TS1M5 | |
64-bit Enabled Solaris | 9.4_M5 | | 9.4 TS1M5 | |
HP-UX IPF | 9.4_M5 | | 9.4 TS1M5 | |
Linux for x64 | 9.4_M5 | | 9.4 TS1M5 | |
Solaris for x64 | 9.4_M5 | | 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: | high |
Date Modified: | 2020-12-07 10:37:09 |
Date Created: | 2020-12-01 13:53:34 |