BeOptimized - Tips and Tricks

Create and use hash objects in SAS

The SAS hash object is meant to enable you to quickly and efficiently store, search, and retrieve data based on lookup keys , Conceptually, the hash object provides programmers the means to easily define and utilize a hash table within the Data Step.

Details

SAS developed different in-memory technics to perform lookup. In this tips and tricks, we will will dive into Hash Object:

  • What is a Hash Object?
  • What is the syntax of an Hash Object?
  • How can we load values in the Hash Object? (manually or from dataset)
  • How can we deal with duplicates ?
  • How can we add more keys to improve unicity?
  • How can we combine different hash objects in a single datastep

In a second step, we will apply the syntax of the hash object during the read phase of a CSV. The idea behind will be to validate the data (compared to a reference table loaded in memory) and to output records to an error table if they don't meet acceptance criteria.

Prerequisites

You have some SAS experience and would like to create and use hash objects in order to speed up your lookup.


Go back to your selection


This site uses cookies. .

By continuing to browse the site you are agreeing to our use of cookies. Review our cookies information for more details.