SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 39472: An SQLPLAN error occurs when you run an SQL procedure query that includes a function within a summary function

DetailsHotfixAboutRate It

When you use a LIBNAME engine with a PROC SQL query that is run against database management system (DBMS) data, you might receive an SQLPLAN error similar to the following:

ERROR: sqlplan internal error: Cannot find symbol #TEMG002, var=3,         
       tag=0003. This message can be caused by attempting to make          
       correlated references between two different items on a single FROM  
       clause.                                                             

The error might occur when a subquery in the procedure includes a function within a summary function, as shown in the following example:

libname oralib oracle user=user-name password=password path=pathname schema=schema-name; proc sql; create table test as select sum(input(ddate,yymmdd8.)-input(adate,yymmdd8.)) as billed_days from (select ddate, adate from oralib.t1, oralib.t2 where t1.id = t2.id); quit;

Currently, the only workaround is to separate the subquery and create a data set in a separate step. Then use that data set as input to the query.

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