Problem Note 42425: SQLPLAN error might occur when creating a new variable based on another new variable
In Base SAS® software, SQLPLAN errors might occur when the following events take place:
- The PROC SQL query contains a subquery or inline view
- A new variable is being created based on a calculated variable
- The new variable is being used in a summary function outside the query
The following code illustrates one case that can produce the SQLPLAN internal error:
proc sql;
create table attempt1 as
select sum(treated)/sum(size) as NYC_AVG
from (select provider_number,
case hcahps_question
when 1 then 50
when 2 then 200
else 400
end as size,
floor((calculated size * hcahps_answer_percent)/100) as treated
from nyc_hosp)
group by provider_number
;
quit;
In this case, the following error messages are generated:
ERROR: sqlplan internal error: Cannot find symbol treated, var=3,
tag=0001. This message can be caused by attempting to make correlated
references between two different items on a single FROM clause.
The workaround is to move the creation of the variable to outside the subquery/inline view.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |
Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Windows Vista | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Windows Vista for x64 | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
64-bit Enabled AIX | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
64-bit Enabled Solaris | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
HP-UX IPF | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Linux | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Linux on Itanium | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
OpenVMS Alpha | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Solaris for x64 | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
Tru64 UNIX | 9.1 TS1M3 SP4 | 9.3 TS1M0 |
*
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: | 2011-02-21 17:18:54 |
Date Created: | 2011-02-17 09:13:19 |