Defines key variables for the hash object.
Applies to: | Hash object |
specifies whether the method succeeded or failed.
specifies the name of the hash object.
specifies the name of the key variable.
specifies all the data variables as keys when the data set is loaded in the object constructor.
h.add(key:99,
data:'apple', data:'orange')
) and the ALL:'YES' option
on the DEFINEKEY method, then you must specify the keys and data in
the same order as they exist in the data set.
h.find(key:'abc')
),
and the SAS compiler cannot detect the key and data variable assignments
done by the hash object and the hash iterator. Therefore, if no assignment
to a key or data variable appears in the program, SAS will issue a
note stating that the variable is uninitialized. To avoid receiving
these notes, you can perform one of the following actions:
length d $20; length k $20; if _N_ = 1 then do; declare hash h(); rc = h.defineKey('k'); rc = h.defineData('d'); rc = h.defineDone(); call missing(k, d); end;