As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Yet Another Lookup Method: Updatable Indexed Data Sets

From sasCommunity
Jump to: navigation, search
Paper 1429-2017
Yet Another Lookup Method: Updatable Indexed Data Sets
Jack Hamilton, Kaiser Permanente

Abstract

SAS ® has many methods of doing table lookups in data steps: formats, arrays, hash objects, the SASMSG function, indexed data sets, and so forth. Of those, hash objects and indexed data sets allow you to specify multiple lookup keys and return multiple table values. Both can be updated dynamically in the middle of a data step as you obtain new information (such as reading new keys from an input file, or creating new synthetic keys). Hash objects are very flexible and fast, and fairly easy to use, but are limited to the amount of data that can be held in memory. Indexed data sets may be slower, but are not limited to what can fit into memory, and so in some circumstances may be your only option. This presentation discusses how to use an indexed data set for table lookup and update it dynamically using the MODIFY statement and its allies.

Resources

Paper, Powerpoint slides, and Sample Code from a presentation at SAS Global Forum 2017

File:1630 Hamilton 1429.pptx

File:YetAnotherLookupMethod-SampleCode.zip

File:1429-2017-hamilton.pdf