Example 3.8 Combining Multiple Data Sets without a Variable Common to All the Data Sets


Combine three tables that do not all share a common column. Each table has one column in common with a second table, but not with the third. Use this relationship to combine all three tables. Compute a new column by using information from two of the tables.

Example Features

Featured StepPROC SQL
Featured Step Options and StatementsCompound WHERE clause
Related TechniqueHash object in the DATA step

Input Tables

Table MAINTENANCE contains a list of maintenance tasks performed on four vehicles identified by VEHICLE_ID. Table VEHICLES contains a list of customer vehicles. Table MAINTCHARGES contains a list of tasks identified by TASK_CODE and the charge ...

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.