Removes all items from the hash object without deleting the hash object instance.
Applies to: | Hash object |
specifies whether the method succeeded or failed.
specifies the name of the hash object.
data mydata;
do i = 1 to 10000;
output;
end;
run;
data _null_;
length i 8;
/* Declares the hash object named MYHASH using the data set MyData. */
dcl hash myhash(dataset: 'mydata');
myhash.definekey('i');
myhash.definedone();
call missing (i);
/* Uses the NUM_ITEMS attribute, which returns the */
/* number of items in the hash object. */
n = myhash.num_items;
put n=;
/* Uses the CLEAR method to delete all items within MYHASH. */
rc = myhash.clear();
/* Writes the number of items in the log. */
n = myhash.num_items;
put n=;
run;
n=10000
n=0