SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 49175: Incorrect sort information might be placed in the header of a SAS® data set that was created by the SQL procedure

DetailsHotfixAboutRate It

Incorrect results might occur when you use a SAS data set that was created by the SQL procedure. This problem occurs when the sorted by information in the header of the SAS data set is incorrect.

Any code in which the invalid information is used to generate results might generate wrong results because the SAS data set is not really sorted by the variables that are listed. The incorrect information might occur when DISTINCT is used in an inline view, and, outside the inline view, the data is grouped by the variables in a different order.

The following code illustrates one case that can produce the issue:

proc sql; create table test as select sex, age, case when flag_sum = 1 then 1 else 0 end as match from (select sex, age, sum(flag) as flag_sum from (select age, sex, case when name in('Alfred','Alice','Carol','Mary') then 1 else 0 end as flag from (select distinct age,sex,name from sashelp.class)) group by sex,age) ; quit;

The only workaround is to split the query into multiple steps rather than using inline views.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASz/OS9.2 TS1M09.4 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS1M09.4 TS1M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS1M09.4 TS1M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS1M09.4 TS1M0
Microsoft Windows XP 64-bit Edition9.2 TS1M09.4 TS1M0
Microsoft® Windows® for x649.2 TS1M09.4 TS1M0
Linux9.2 TS1M0
HP-UX IPF9.2 TS1M0
Microsoft Windows Server 2003 Standard Edition9.2 TS1M0
Microsoft Windows XP Professional9.2 TS1M09.4 TS1M0
Windows Vista9.2 TS1M09.4 TS1M0
Windows Vista for x649.2 TS1M09.4 TS1M0
64-bit Enabled AIX9.2 TS1M09.4 TS1M0
64-bit Enabled HP-UX9.2 TS1M09.4 TS1M0
64-bit Enabled Solaris9.2 TS1M09.4 TS1M0
Linux for x649.2 TS1M09.4 TS1M0
OpenVMS on HP Integrity9.2 TS1M09.4 TS1M0
Solaris for x649.2 TS1M09.4 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.2 TS1M0
Microsoft Windows Server 2003 for x649.2 TS2M0
Microsoft Windows Server 2008 for x649.2 TS2M09.4 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.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.