Example 4.2 Performing a Table Lookup in a Small Lookup Data Set

Goal

Perform a table lookup based on more than one key where the lookup data set is small and not indexed. Subset the observations from the primary data set into one of two output data sets based on specific criteria that are supplied by the lookup data set.

Example Features

Featured StepDATA step
Featured Step Options and StatementsSET statement, NOBS= option Two-dimensional arrays
Related TechniqueHash object in the DATA step
A Closer LookProcessing the Two-Dimensional Array WT Understanding Temporary Arrays

Input Data Sets

Data set BTEAM contains data on team members' height, weight, and body type.

                          BTEAM

   Obs    lname        gender    height    weight     type 1 Adams M 67 160 2 2 Alexander M 69 ...

Get Combining and Modifying SAS® Data Sets: Examples Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.