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.6 Performing a "Chained" Lookup

Goal

Trace the links that associate observations in one data set. Assume there are no breaks in the chain.

Example Features

Featured StepDATA step
Featured Step Options and StatementsHash object in the DATA step
Related TechniqueDATA step, BY-group processing, RETAIN statement

Input Data Set

Data set FLEET_REGISTRATION contains registration transactions for three vehicles. Variable VEHICLE_ID uniquely identifies the vehicle. The values for REGISTRATION change when the vehicle is transferred. When ACTION= "XFER", the vehicle has been transferred and its new registration ID is stored in variable NEW_REG. There are no breaks in the links between observations for a vehicle because all values of NEW_REG ...

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