Problem Note 11805: Result of assignment of an array element may be incorrect
The result of assigning a value of an array element may be incorrect
due to incorrect optimization of code associated with the array index.
The incorrect behavior may not be observed when executing the code
under the debugger or if certain statement(s) are executed prior to
the assignment.
To circumvent the incorrect behavior, set the (undocumented) system
option CGOPTIMIZE to 0. For example:
OPTIONS CGOPTIMIZE=0;
The following code provides an example of the incorrect behavior:
data x;
input i;
datalines;
3
;
data _null_;
array a[3] (1,2,3);
i = 2;
a[i] = -99;
/* uncomment this statement to obtain correct results */
*i = 100;
set x;
put i=;
y = a[i];
put y=;
run;
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#011805
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#011805
Operating System and Release Information
| SAS System | Base SAS | OpenVMS VAX | 8.2 TS2M0 | 9.2 TS1M0 |
| Microsoft Windows 2000 Professional | 8.2 TS2M0 | 9.1 TS1M3 SP4 |
*
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 |
| Date Modified: | 2004-03-12 10:32:24 |
| Date Created: | 2004-02-17 12:34:28 |