Methods of Combining SAS Data Sets: The Basics

A common task in SAS programming is to combine observations from two or more data sets into a new data set. Using the DATA step, you can combine data sets in several ways.
Table 10.1 Quick-Reference Overview of Data-Combining Methods
Method of Combining
Illustration
One-to-one reading
Creates observations that contain all of the variables from each contributing data set.
Combines observations based on their relative position in each data set.
Statement: SET
One-to-one merging
Concatenating
Appends the observations from one data set to another.
Statement: SET
Concatenating
Match-merging
Matches observations from two or more data sets into a single observation in a new data set according to the values of a common variable.
Statements: MERGE, BY
Match-merging
Tip
You can also use PROC SQL to join data sets according to common values.
Last updated: August 23, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.111.92