SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 41011: Use of HAVING clause with SQL GROUP BY may return incorrect results

DetailsHotfixAboutRate It

A parallel GROUP BY clause can generate incorrect results for variables with non-standard length columns if a HAVING clause is used.

The following code illustrates a case that can produce incorrect results in columns YEAR and SUM(PAY_MTS):

 
  libname foo sasspds 'public' server=hostname.5400 user='anonymous' 
  ip=yes libgen=yes;

  data foo.mytest;
    length year 3 abc 3 paid $1 chargeable $1 pay_mts 8;
    input year abc paid $ chargeable $ pay_mts;
    cards;
    2010 100 y n 200
    ;
  run;

  proc sql;
  select distinct abc, chargeable, paid, year, sum(pay_mts)
     from foo.mytest
     group by abc, chargeable, paid, year having count(*) gt 0;
  quit;

Select the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SPDSScalable Performance Data ServerMicrosoft Windows 2000 Advanced Server4.524.53
Microsoft Windows 2000 Datacenter Server4.524.53
Microsoft Windows 2000 Server4.524.53
Microsoft Windows 2000 Professional4.524.53
Microsoft Windows Server 2003 Datacenter Edition4.524.53
Microsoft Windows Server 2003 Enterprise Edition4.524.53
Microsoft Windows Server 2003 Standard Edition4.524.53
Microsoft Windows Server 20084.524.53
Microsoft Windows XP Professional4.524.53
64-bit Enabled AIX4.524.53
64-bit Enabled HP-UX4.524.53
64-bit Enabled Solaris4.524.53
HP-UX IPF4.524.53
Linux for x644.524.53
Solaris for x644.524.53
* 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.