Interleaving: Details

Interleaving Syntax

When you use a BY statement to concatenate data sets, the result is interleaving. Interleaving intersperses observations from two or more data sets, based on one or more common variables.
To interleave SAS data sets, specify a list of data set names in the SET statement, and specify one or more BY variables in the BY statement.
Syntax, DATA step for interleaving:
DATA output-SAS-data-set;
SET SAS-data-set-1 SAS-data-set-2;
BY variable(s);
RUN;
  • 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.
  • variable(s) specifies one or more variables that are used to interleave observations.
Tip
Specify any ...

Get SAS Certification Prep Guide, 4th 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.