SAS goes through two phases when processing a data step.

Compilation Phase

​In the compilation phase, SAS does two things:

  1. It checks the code for syntax error.
  2. It creates the input buffer, PDV and the descriptor portion of the data set if no syntax error is found.

Execution Phase

In the execution phase, SAS does the following:

  1. It reads the first line of data into the input buffer.
  2. The input pointer reads the data from input buffer into the PDV.
  3. The PDV writes the first observation onto the data set.
  4. The PDV empties the variables created by the INPUT statement and resets the _n_ and _error_ variables.
  5. SAS repeats the process for the second line of data and continues until all of the observations are written to the data set.