SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Debugging and Testing DATA Steps
Understanding DATA Step Processing


Compilation Phase

At the beginning of the compilation phase, the program data vector is created.

     data finance.duejan;
        set finance.loans;
        Interest=amount*(rate/12);
     run;

The program data vector is the area of memory where SAS builds a data set, one observation at a time. The term program data vector refers to a logical concept and does not necessarily reflect the physical storage of data.


Program Data Vector


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 in the PDV.

During the compilation phase, SAS 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