SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 31122: SQLPLAN internal errors might occur when you select columns from an SQL view

DetailsCodeHotfixAboutRate It

In Base SAS® software, SQLPLAN internal errors might occur when you select columns from an SQL view or from an in-line view if one or more of the following conditions are true:

  • a count(*) function and an ORDER BY clause are referenced in the outer SELECT statement
  • the inner SELECT statement has an aliased column
  • the outer SELECT statement redefines the aliased column and gives it a different name.

The following code illustrates syntax that can produce the SQLPLAN internal errors. Note that this code is intended to be run as a stand-alone piece of code, but it illustrates the incorrect syntax.

   proc sql;                              
      create view view1 as                    
         select distinct                        
                comm_level_1 as clevel               
                ,comm_level_1                        
                ,sum(curr_inv) as base_curr_inv       
         from libref.table                       
      group by clevel, comm_level_1;         
                                        
      create table test1 as                   
         select count(*) as rowcount,            
                clevel,                         
                comm_level1 as comm_level_2,    
                base_curr_inv as ordercol       
         from view1                              
      order by ordercol desc;                
   quit;     	



Select 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.1 TS1M3 SP49.2 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows XP 64-bit Edition9.1 TS1M3 SP49.2 TS1M0
Microsoft® Windows® for x649.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Advanced Server9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Datacenter Server9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Server9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Professional9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows NT Workstation9.1 TS1M3 SP49.1 TS1M3 SP4
Microsoft Windows Server 2003 Datacenter Edition9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows Server 2003 Standard Edition9.1 TS1M3 SP49.2 TS1M0
Microsoft Windows XP Professional9.1 TS1M3 SP49.2 TS1M0
Windows Vista9.1 TS1M3 SP49.2 TS1M0
64-bit Enabled AIX9.1 TS1M3 SP49.2 TS1M0
64-bit Enabled HP-UX9.1 TS1M3 SP49.2 TS1M0
64-bit Enabled Solaris9.1 TS1M3 SP49.2 TS1M0
HP-UX IPF9.1 TS1M3 SP49.2 TS1M0
Linux9.1 TS1M3 SP49.2 TS1M0
Linux on Itanium9.1 TS1M3 SP49.2 TS1M0
OpenVMS Alpha9.1 TS1M3 SP49.2 TS1M0
Tru64 UNIX9.1 TS1M3 SP49.2 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.