Previous Page | Next Page

Merging SAS Data Sets

Understanding the MERGE Statement

You merge data sets using the MERGE statement in a DATA step. The form of the MERGE statement that is used in this section is the following:

MERGE SAS-data-set-list;
BY variable-list;
SAS-data-set-list

is the names of two or more SAS data sets to merge. The list may contain any number of data sets.

variable-list

is one or more variables by which to merge the data sets. If you use a BY statement, then the data sets must be sorted by the same BY variables before you can merge them.

Previous Page | Next Page | Top of Page