SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 67011: A query that is passed to the database might include an incorrect variable name in the GROUP BY clause

DetailsHotfixAboutRate It

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

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemBase SASz/OS9.4_M59.4 TS1M5
z/OS 64-bit9.4_M59.4 TS1M5
Microsoft® Windows® for x649.4_M59.4 TS1M5
Microsoft Windows 8 Enterprise 32-bit9.4_M59.4 TS1M5
Microsoft Windows 8 Enterprise x649.4_M59.4 TS1M5
Microsoft Windows 8 Pro 32-bit9.4_M59.4 TS1M5
Microsoft Windows 8 Pro x649.4_M59.4 TS1M5
Microsoft Windows 8.1 Enterprise 32-bit9.4_M59.4 TS1M5
Microsoft Windows 8.1 Enterprise x649.4_M59.4 TS1M5
Microsoft Windows 8.1 Pro 32-bit9.4_M59.4 TS1M5
Microsoft Windows 8.1 Pro x649.4_M59.4 TS1M5
Microsoft Windows 109.4_M59.4 TS1M5
Microsoft Windows Server 20089.4_M59.4 TS1M5
Microsoft Windows Server 2008 R29.4_M59.4 TS1M5
Microsoft Windows Server 2008 for x649.4_M59.4 TS1M5
Microsoft Windows Server 2012 Datacenter9.4_M59.4 TS1M5
Microsoft Windows Server 2012 R2 Datacenter9.4_M59.4 TS1M5
Microsoft Windows Server 2012 R2 Std9.4_M59.4 TS1M5
Microsoft Windows Server 2012 Std9.4_M59.4 TS1M5
Microsoft Windows Server 20169.4_M59.4 TS1M5
Windows 7 Enterprise 32 bit9.4_M59.4 TS1M5
Windows 7 Enterprise x649.4_M59.4 TS1M5
Windows 7 Home Premium 32 bit9.4_M59.4 TS1M5
Windows 7 Home Premium x649.4_M59.4 TS1M5
Windows 7 Professional 32 bit9.4_M59.4 TS1M5
Windows 7 Professional x649.4_M59.4 TS1M5
Windows 7 Ultimate 32 bit9.4_M59.4 TS1M5
Windows 7 Ultimate x649.4_M59.4 TS1M5
64-bit Enabled AIX9.4_M59.4 TS1M5
64-bit Enabled Solaris9.4_M59.4 TS1M5
HP-UX IPF9.4_M59.4 TS1M5
Linux for x649.4_M59.4 TS1M5
Solaris for x649.4_M59.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.