Problem Note 7831: PROC SQL join of a view and a SAS data set can return different results
The join of a SAS data set with an SQL view can produce different
results. In order for the problem to occur the view must produce a
cartesian product.
Below is an example of a join which will cause the problem:
proc sql;
create table all_j (j integer);
insert into all_j values (0);
insert into all_j values (1);
insert into all_j values (2);
insert into all_j values (3);
create table test (i integer, j integer);
insert into test values (1, 1);
insert into test values (1, 3);
create view max_j1 as
select distinct i, max(j) as max_j from test group by i;
create table v3 as
select *
from all_j, max_j1
where (( all_j.j < max_j1.max_j)
and (all_j.j >= max_j1.i))
;
Altering the syntax above to make MAX_J1 a table rather then a view will
produce the correct results.
A Technical Support hot fix for Release 8.2 TSLEVEL TS2M0 for this
issue is available at:
http://www.sas.com/techsup/download/hotfix/82_sbcs_prod_list.html#007831
For customers running SAS with Asian Language Support (DBCS), this
hot fix should be downloaded from:
http://www.sas.com/techsup/download/hotfix/82_dbcs_prod_list.html#007831
Operating System and Release Information
| SAS System | Base SAS | Windows Millennium Edition (Me) | 8.2 TS2M0 | |
| Microsoft Windows 95/98 | 8.2 TS2M0 | |
| Microsoft Windows NT Workstation | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows 2000 Server | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows 2000 Professional | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | 9 TS M0 |
| Solaris | 8.2 TS2M0 | 9 TS M0 |
| OpenVMS VAX | 8.2 TS2M0 | 9 TS M0 |
| 64-bit Enabled Solaris | 8.2 TS2M0 | 9 TS M0 |
| z/OS | 8.2 TS2M0 | 9 TS M0 |
| IRIX | 8.2 TS2M0 | 9 TS M0 |
| OS/2 | 8.2 TS2M0 | |
| Linux | 8.2 TS2M0 | 9 TS M0 |
| 64-bit Enabled HP-UX | 8.2 TS2M0 | 9 TS M0 |
| HP-UX | 8.2 TS2M0 | 9 TS M0 |
| ABI+ for Intel Architecture | 8.2 TS2M0 | 9 TS M0 |
| CMS | 8.2 TS2M0 | 9 TS M0 |
| OpenVMS Alpha | 8.2 TS2M0 | 9 TS M0 |
| 64-bit Enabled AIX | 8.2 TS2M0 | 9 TS M0 |
| Tru64 UNIX | 8.2 TS2M0 | 9 TS M0 |
| AIX | 8.2 TS2M0 | 9 TS M0 |
| Microsoft Windows XP Professional | 8.2 TS2M0 | 9 TS M0 |
*
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 |
| Topic: | SAS Reference ==> Procedures ==> SQL SAS Reference ==> SQL
|
| Date Modified: | 2008-12-09 12:27:48 |
| Date Created: | 2002-06-20 15:14:08 |