SAS Support Site Home | Samples and SAS Notes Home
SAS Notes V6-QUERY-B894
Incorrect GROUP BY generated when SAS column contains format for ORACLE


An incorrect GROUP BY clause may be generated for an DBMS table when your access mode is ORACLE. The problem will occur when you define a SAS format for an ORACLE column name and you also choose to GROUP BY this column. The syntax of the GROUP BY clause will be incorrect. The following is an example of an incorrect query:

       select dept format=$10., ex1 as totsal
       from connection to oracle(
          select a1."dept", sum(a1."salary")
          from oracle_table
          group by a1."dept format=$10")
          as t1(dept, ex1);

The error is caused by the FORMAT=$10 specified on the GROUP BY statement which is passed to the database as part of the column name. The problem occurs in Release 6.09E TS450, Release 609 TS042 and beyond, Release 6.11 TS020, Release 6.11 TS040 and Release 6.12 TS020. The problem will be corrected in Release 6.12 TS045. Currently, the SQL passthru query can be saved to an external file or source entry, corrected, and then submitted from the DMS Program Editor.


Products: BASE
Component: QUERY
Priority: HIGH
Status: Outstanding Problem
Date: Wed, 30 Apr 1997

System Release Reported Release Fixed
Windows NT 6.12 TS020 6.12 TS045  
Windows 3.11 6.12 TS020 6.12 TS045  
Windows 95 6.12 TS020 6.12 TS045  
Windows 95 6.11 TS040 6.12 TS045  
Windows NT 6.11 TS040 6.12 TS045  
Windows 3.11 6.11 TS040 6.12 TS045  
Compaq Tru64 Unix 6.11 TS040 6.12 TS040  
Silicon Graphics Unix 6.11 TS040  
Intel ABI 6.11 TS040  
Macintosh 6.12 TS040  
Compaq Tru64 Unix 6.12 TS040  
OpenVMS Alpha 6.12 TS020 6.12 TS045  
AIX/6000 6.12 TS020 6.12 TS045  
HP-UX Operating Systems 6.12 TS020 6.12 TS045  
IBM OS/2 6.12 TS020 6.12 TS045  
Solaris 6.12 TS020 6.12 TS045  
AIX/6000 6.11 TS020 6.12 TS045  
HP-UX Operating Systems 6.11 TS020 6.12 TS045  
IBM OS/2 6.11 TS020 6.12 TS045  
Solaris 6.11 TS020 6.12 TS045  
VM/ESA (CMS) 6.09 TS450  
OS/390 (MVS) 6.09 TS450  
OpenVMS VAX 6.09 TS450  
AIX/6000 6.09 TS042 6.12 TS045  
HP-UX Operating Systems 6.09 TS042 6.12 TS045  
Solaris 6.09 TS042 6.12 TS045  
OpenVMS Alpha 6.09 TS044 6.12 TS045  

No Fixes Available