SAS Support Site Home | Samples and SAS Notes Home
SAS Notes V6-SQL-C524
Incorrect results when joining a SAS data file with a DATA step view


It is possible to receive incorrect results from a PROC SQL query which joins two or more SAS data sets. The problem occurs when at least one of the input data sets is a DATA step view and a equal condition exists in the WHERE clause between a variable in the DATA step view and a variable in another SAS data set. An example of a query which will produce incorrect results is:

    select a.flight, a.dest, orig, count(*)
    from dset a, dsview b where a.flight=b.flight and a.dest=b.dest;

In this query, DSET is a SAS data set and DSVIEW is a DATA step view. The current circumvention is to create a SAS data set from the DATA stepview and use the data set rather than the view in the PROC SQL query.

The problem occurs in Release 6.08 TS420 and beyond, Release 6.09E, Release 6.09 TS042 and beyond, Release 6.11 TS020, Release 6.11 TS040 and Release 6.12 TS020. The problem is corrected for Release 6.08 TS420and beyond and Release 6.09E TS455. The problem is corrected for Release 6.09 TS042 and beyond, Release 6.11 TS020, Release TS040 and Release 6.12 TS020 in Release 6.12 TS045.


Products: BASE
Component: SQL
Priority: ALERT
Status: Outstanding Problem
Date: Thu, 6 Mar 1997

System Release Reported Release Fixed
VM/ESA (CMS) 6.08 TS420 6.09 TS455  
OS/390 (MVS) 6.08 TS420 6.09 TS455  
OpenVMS VAX 6.08 TS420 6.09 TS455  
VSE/ESA (VSE) 6.08 TS420  
VM/ESA (CMS) 6.09 TS450 6.09 TS455  
OS/390 (MVS) 6.09 TS450 6.09 TS455  
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  
OpenVMS VAX 6.09 TS450 6.09 TS455  
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  
Windows 3.11 6.11 TS020 6.12 TS045  
Intel ABI 6.11 TS040  
Silicon Graphics Unix 6.11 TS040  
Compaq Tru64 Unix 6.11 TS040 6.12 TS040  
Windows NT 6.11 TS040 6.12 TS045  
Windows 95 6.11 TS040 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  
OpenVMS Alpha 6.12 TS020 6.12 TS045  
Windows 3.11 6.12 TS020 6.12 TS045  
Windows NT 6.12 TS020 6.12 TS045  
Windows 95 6.12 TS020 6.12 TS045  

No Fixes Available