Concatenating

Overview

Another way to combine SAS data sets with the SET statement is concatenating, which appends the observations from one data set to another data set. To concatenate SAS data sets, you specify a list of data set names in the SET statement.
General form, basic DATA step for concatenating:
DATA output-SAS-data-set;
SET SAS-data-set-1 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 Concatenating Selects Data

When a program concatenates data sets, all of the observations are read from the first data set listed in the SET statement. Then all of the observations are read from the second data ...

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.