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.2 Merging Observations from Multiple Data Sets by a Common Variable

Goal

Combine observations from multiple data sets based on a variable common to each contributing data set.

Example Features

Featured StepDATA step
Featured Step Options and StatementsMatch-merge with MERGE and BY statement
Related TechniquePROC SQL, multiway join with WHERE clause
A Closer LookUnderstanding How the DATA Step Processes a Match-Merge

Input Data Sets

Data set AGENTS contains the names and IDs of five real estate agents. Data set PROPERTIES contains a list of properties that have sold. The agent responsible for the sale is identified by the ID variable. Data set RATES contains the commission rates for the five agents with the agent identified by the ID ...

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