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
specifies the names of two or more SAS data sets to merge. The list can contain any number of data sets.
variable-list
specifies 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.

Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.