SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Understanding DATA Step Processing
Compilation Phase


At the beginning of the compilation phase, the input buffer, an area of memory, is created to hold a record from the external file. The input buffer is created only when raw data is read, not when a SAS data set is read. The term input buffer refers to a logical concept and does not necessarily reflect the physical storage of data.

input buffer

Then the program data vector is created. The program data vector is the area of memory where SAS software builds a data set, one observation at a time. Like the term input buffer, the term program data vector refers to a logical concept.


The program data vector contains two automatic variables that can be used for processing but are not written to the data set as part of an observation.

  • _N_ counts the number of times that the DATA step has begun to execute.

  • _ERROR_ signals the occurrence of an error caused by the data during execution. The default value is 0, which means there is no error. When an error occurs, whether one error or a number of errors, the value is set to 1.

Automatic Variables

During the compilation phase, SAS software also scans each statement in the DATA step, looking for syntax errors. Syntax errors include:
  • missing or misspelled keywords
  • invalid variable names
  • missing or invalid punctuation
  • invalid options.

back||next


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

Terms of Use & Legal Information | Privacy Statement