Problem Note 66133: The LAST method might incorrectly return a nonzero return code within a DATA step that is using hash objects
The LAST method might incorrectly return a nonzero return code within a DATA step that is using hash objects. The following example illustrates the problem. This program adds an item to the hash, and the LAST method should fetch that item and produce a zero return code. Instead, the item is not fetched and the LAST method returns nonzero, which indicates an error.
The circumvention is to un-comment the highlighted line of code below:
data _null_;
declare hash h(multidata:'yes');
declare hiter itr(hash:'h');
h.defineKey('k');
h.defineData('d');
h.defineDone();
k = 1;
do d = 1 to 3;
h.add();
end;
rc = itr.last();
put rc=;
run;
/***************************************/
/* This program adds an item to the hash and the LAST method should */
/* fetch that item and return zero. Instead, the item is not fetched */
/* and the LAST method returns nonzero, which indicates an error. */
data _null_;
length state $ 2 city $ 32;
dcl hash h(multidata:'y');
h.definekey('state');
h.definedata('city');
h.definedone();
/* Uncomment the next line for a workaround */
/* if 0 then h.find_prev(); */
state = 'NC'; city = 'Raleigh'; h.add();
dcl hiter hi('h');
state = ' ';
city = ' ';
rc = hi.last();
put rc= state= city=;
run;
The following is the log output:
rc=160038 state= city=
Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
z/OS 64-bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft® Windows® for x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Enterprise 32-bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Enterprise x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Pro 32-bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Pro x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Enterprise x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Pro 32-bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Pro x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 10 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 Datacenter | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 R2 Datacenter | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 R2 Std | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 Std | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2016 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2019 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Enterprise 32 bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Enterprise x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Home Premium 32 bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Home Premium x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Professional 32 bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Professional x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Ultimate 32 bit | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Ultimate x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
64-bit Enabled AIX | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
64-bit Enabled Solaris | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
HP-UX IPF | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Linux for x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
Solaris for x64 | 9.4_M6 | 9.4_M7 | 9.4 TS1M6 | 9.4 TS1M7 |
*
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: | 2020-06-16 12:35:46 |
Date Created: | 2020-06-15 16:52:23 |