Example 3.2 Merging Observations from Multiple Data Sets by a Common Variable
Combine observations from multiple data sets based on a variable common to each contributing data set.
|Featured Step||DATA step|
|Featured Step Options and Statements||Match-merge with MERGE and BY statement|
|Related Technique||PROC SQL, multiway join with WHERE clause|
|A Closer Look||Understanding 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 ...