SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Merging SAS Data Sets
Match-Merge Processing


The examples in this lesson are straightforward. However, match-merging can be more complex, depending on your data and the output data set you want to create. To predict the results of match-merges correctly, you need to understand how the DATA step performs match-merges.

When you submit a DATA step, it is processed in two phases:

  • the compilation phase, in which SAS software checks the syntax of the SAS statements and compiles them (translates them into machine code). During this phase, SAS software also sets up descriptor information for the output data set and creates the program data vector (PDV), an area of memory where SAS software builds your data set, one observation at a time.

compilation phase

  • the execution phase, in which the DATA step reads data and executes any subsequent programming statements. When the DATA step executes, data values are read into the appropriate variables in the program data vector. From here, the variables are written to the output data set as a single observation.

execution phase

The following pages cover DATA step processing in greater detail. In them, you learn
  • how the DATA step sets up the new output data set
  • what happens when variables in different data sets have the same name
  • how the DATA step matches observations in input data sets
  • what happens when observations don't match
  • how missing values are handled.

back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement