O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 4.5 Performing a Table Lookup When the Lookup Data Set Is Indexed

Goal

Combine two data sets by using a table lookup technique that directly accesses the lookup data set through an index on a key variable. This lookup technique is appropriate for a large lookup data set.

Example Features

Featured StepDATA step
Featured Step Options and StatementsSET statement, KEY= option Automatic variable_IORC_Macro function %SYSRC
Related TechniquePROC SQL, INNER JOIN, ON clause, subqueries

Input Data Sets

Data set INVOICES contains a list of invoices for five insurance policies. Data set POLICIES contains data for 12 policy holders.

                   INVOICES

Obs         id      salesdate      amount 1 JL80SHJ0981I 05/01/2009 $543.22 2 LZJ4NWZOPH1W 05/01/2009 $910.09 3 6VIKYDYXMC8I ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required