Returns the size (in bytes) of an item in a hash object.
Applies to: | Hash object |
specifies the name of the variable that contains the size of the item in the hash object.
specifies the name of the hash object.
data work.stock;
input prod $1-10 qty 12-14;
datalines;
broccoli 345
corn 389
potato 993
onion 730
;
data _null_;
if _N_ = 1 then do;
length prod $10;
/* Declare hash object and read STOCK data set as ordered */
declare hash myhash(dataset: "work.stock");
/* Define key and data variables */
myhash.defineKey('prod');
myhash.defineData('qty');
myhash.defineDone();
end;
/* Add a key and data value to the hash object */
prod = 'celery';
qty = 183;
rc = myhash.add();
/* Use ITEM_SIZE to return the size of the item in hash object */
itemsize = myhash.item_size;
put itemsize=;
run;
itemsize=40
is
written to the SAS log.