David V. Cole |
Hash programming in SAS allows users to store and retrieve information from in-memory objects. While often thought of first as a means for more efficient table lookups, hash programming has much broader applications, in large part because it is used within DATA-step processing.
The creation of summary tables is a common task in SAS. While hash can be used to create simple summary tables via straightforward code, the programming techniques can be extended and combined with other DATA-step functionality to generate multi-level summaries within a single data step from one pass through the data.
This paper discusses the considerations behind using hash to construct various types of summaries and provides code to demonstrate how to use the power of hash in SAS to create flexible, efficient code for complex tasks. |