Problem Note 8927: PROC SQL can produce incorrect results when short numeric variables are
summed
When you use the SUM function in PROC SQL to sum an equation which is
based on short numerics, the resulting output is incorrect.
Research indicates the incorrect result is due to variables overlaying
one another and is isolated to the OS/390 platform.
Because the problem is associated with the internal code PROC SQL
generates, you may circumvent the problem by setting the following
statement option:
proc sql nocodegen;
Below is a test program which demonstrates the problem:
data a;
length u w 2 v y 4;
do year=1999 to 2000;
do month=1 to 12;
do day=1 to 5;
do hour=9 to 17;
u=1;
v=1;
w=.;
x=.;
y=2;
z=1;
output;
end;
end;
end;
end;
run;
proc sql;
title 'SUMYZ should be 2 on every record of output';
select year,month,day,hour,
sum(u*v) as sumuv,
sum(w*x) as sumwx,
sum(y*z) as sumyz
from a
group by year,month,day,hour;
quit;
A Technical Support hot fix for Release 8.2 (TS2M0) for this
issue is available at:
http://www.sas.com/techsup/download/hotfix/82_sbcs_prod_list.html#008927
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#008927
Operating System and Release Information
| SAS System | Base SAS | z/OS | 8.2 TS2M0 | 8.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.
| Type: | Problem Note |
| Priority: | alert |
| Topic: | SAS Reference ==> Procedures ==> SQL SAS Reference ==> SQL
|
| Date Modified: | 2003-02-27 08:44:57 |
| Date Created: | 2002-11-19 15:11:34 |