One-to-One Merging

Overview

In Reading SAS Data Sets, you learned how to use the SET statement to read an existing SAS data set. You can also use multiple SET statements in a DATA step to combine data sets. This is called one-to-one merging (or combining). In one-to-one merging you can read different data sets, or you can read the same data set more than once, as if you were reading from separate data sets.
General form, basic DATA step for one-to-one reading:
DATA output-SAS-data-set;
SET SAS-data-set-1;
SET SAS-data-set-2;
RUN;
where
  • output-SAS-data-set names the data set to be created
  • SAS-data-set-1 and SAS-data-set-2 specify the data sets to be read.

How One-to-One Merging Selects Data

When you perform ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition 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.