Traverses a list of duplicate keys in the hash object.
| Applies to: | Hash object |
specifies the name of the hash object.
specifies the key value whose type must match the corresponding key variable that is specified in a DEFINEKEY method call.
dup, that contains
duplicate keys. The DO_OVER and RESET_DUP methods are used to iterate
through the duplicate keys.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
;
run;
data _null_;
length r 8;
dcl hash h(dataset:'dup', multidata: 'y', ordered: 'y');
h.definekey('key');
h.definedata('key', 'data');
h.definedone();
h.reset_dup();
key = 2;
do while(h.do_over(key:key) eq 0);
put key= data=;
end;
key = 3;
do while(h.do_over(key:key) eq 0);
put key= data=;
end;
key = 2;
do while(h.do_over(key:key) eq 0);
put key= data=;
end;
run;key=2 data=11 key=2 data=16 key=2 data=9 key=3 data=20 key=3 data=100 key=2 data=11 key=2 data=16 key=2 data=9