Sets the current list item to the next item in the current key's multiple item list and sets the data for the corresponding data variables.
| Applies to: | Hash object |
specifies whether the method succeeded or failed.
specifies the name of the hash object.
dup. data dup;
length key data 8;
input key data;
datalines;
1 10
2 11
1 15
3 20
2 16
2 9
3 100
5 5
1 5
4 6
5 99
;
data _null_;
dcl hash h(dataset:'dup', multidata: 'y');
h.definekey('key');
h.definedata('key', 'data');
h.definedone();
/* avoid uninitialized variable notes */
call missing (key, data);
do key = 1 to 5;
rc = h.find();
if (rc = 0) then do;
put key= data=;
rc = h.find_next();
do while(rc = 0);
put 'dup ' key= data;
rc = h.find_next();
end;
end;
end;
run;key=1 data=10 dup key=1 5 dup key=1 15 key=2 data=11 dup key=2 9 dup key=2 16 key=3 data=20 dup key=3 100 key=4 data=6 key=5 data=5 dup key=5 99