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 ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.