Problem Note 13188: DATA step component object FIND method not updating properly
The FIND method may fail to update the variable used to supply the key
value after the key is successfully found in the hash table. This
problem occurs when the variable specified in the FIND is also defined
as data in the hash table. The following example illustrates the
incorrect behavior:
data _null_;
declare hash h();
h.definekey ('from');
h.definedata ('from','to');
call missing(from,to);
h.definedone ();
from = 25;
to = 1;
rc=h.add ();
from = 35;
to = 25;
rc=h.find(key:to);
put "Variable 'to' is not updated: " rc= to= from=;
run;
SAS log output:
Variable 'to' is not updated: rc=0 to=25 from=25
The work around for this problem is to use a variable that has not
been defined as data in the hash table to supply the key value, as in
the following example:
data _null_;
declare hash h();
h.definekey('from');
h.definedata('from','to');
call missing(from,to);
h.definedone();
from=25;
to=1;
rc=h.add();
x=25;
rc=h.find(key:x);
put "Variable 'to' is updated: " rc= to= from=;
run;
SAS log output:
Variable 'to' is updated: rc=0 to=1 from=25
This problem corrected in SAS 9.2.
Operating System and Release Information
| SAS System | Base SAS | Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | 9.2 TS1M0 |
| z/OS | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows 2000 Server | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows 2000 Professional | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows NT Workstation | 9.1 TS1M0 | |
| HP-UX IPF | 9.1 TS1M0 | 9.2 TS1M0 |
| 64-bit Enabled Solaris | 9.1 TS1M0 | 9.2 TS1M0 |
| 64-bit Enabled HP-UX | 9.1 TS1M0 | 9.2 TS1M0 |
| 64-bit Enabled AIX | 9.1 TS1M0 | 9.2 TS1M0 |
| Microsoft Windows XP Professional | 9.1 TS1M0 | 9.2 TS1M0 |
| Linux | 9.1 TS1M0 | 9.2 TS1M0 |
| OpenVMS Alpha | 9.1 TS1M0 | 9.2 TS1M0 |
| Tru64 UNIX | 9.1 TS1M0 | 9.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: | medium |
| Topic: | SAS Reference ==> Component Objects
|
| Date Modified: | 2004-08-30 10:01:47 |
| Date Created: | 2004-08-30 10:01:47 |