Summary

Statements

MERGE SAS-data-set-list;
BY variable-list;
The MERGE statement reads observations in multiple SAS data sets and combines them into one observation in one new SAS data set. SAS-data-set-list is a list of the SAS data sets to merge. The list can contain any number of data sets.
Variable-list is the name of 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. If you do not use a BY statement, then SAS merges observations based on their positions in the original data sets.

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.