Data Step Processing [3-9]

h

Phase 1: Compilation Phase

SAS enters the compilation phase when you click the running-man icon, which submits the code.

During the compilation phase, SAS checks the syntax of the data step.

Below is an example of a data step that contains a syntax error:

Data Profile;
Input Name $ Age;
Dline;
Khan 28
Natalia 32
Tommy 29
Lee 34
;
Run;

​In this example, the code DATALINES is misspelled as DLINE.

This is a syntax error that is identified in the compilation phase.

When encountering a syntax error, SAS writes an error message to the Log window:

ERROR: No DATALINES or INFILE statement.

SAS stops proceeding to the next phase. No data set is created.

✍️ Exam Tips

Two things happen when SAS encounters a syntax error:
- SAS writes an error message to the SAS log explaining the error.
- The data step stops executing. No data set is created.

? Sample Exam Question(s):

Question 1

Tips: when working on the sample exam question, move the tab to the window on the right-hand-side for better viewing.

Get Solution