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 3.11 Generating Every Combination of Observations between Data Sets Based on a Common Variable When an Index Is Available

Goal

Combine two data sets that have a common variable where the common variable has duplicate values in both data sets and at least one of the data sets is indexed by the common variable. Produce a data set that contains all possible combinations of the observations where the values from the common variable match. Use indexing features to match the two data sets.

Example Features

Featured StepDATA step
Featured Step Options and StatementsKEY= option in the SET statement Automatic variable _IORC_ and %SYRC autocall macro program
Related TechniquePROC SQL, WHERE clause and subqueries
A Closer LookChecking for Errors ...

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