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.1 Merging Data Sets by a Common Variable

Goal

Match and merge observations from two data sets based on a variable common to both. To make the new data set more informative, create a new variable whose values indicate the data set origin of each observation, and replace the missing values that result from the merge operation with meaningful values.

Example Features

Featured StepDATA step
Featured Step Options and StatementsMatch-merge with MERGE and BY statements IN= data set option
Related TechniquePROC SQL, FULL JOIN, COALESCE function

Input Data Sets

Data set TASKS contains task assignments for five employees. Data set HOURS contains the available hours for five employees. Some employees have data in only one of the two data sets ...

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