Using Hash Objects as Lookup Tables
Overview
Beginning
with SAS 9, the hash object is available for use in a DATA step. The
hash object provides an efficient, convenient mechanism for quick
data storage and retrieval.
Unlike an array, which
uses a series of consecutive integers to address array elements, a
hash object can use any combination of numeric and character values
as addresses. Also unlike arrays, which return only a single value,
hash objects can return multiple values from a given lookup. A hash
object can be loaded from hardcoded values or a SAS data set, is sized
dynamically, and exists for the duration of the DATA step.
The hash object is a good choice for lookups that use unordered data that can fit into memory because it provides ...
Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.