I. Text Summary
To go to the page where a task, programming feature, or concept was
presented, select a link.
DATA Step Processing
A SAS DATA step is processed in
two distinct phases. During the
compilation phase, each statement is scanned for syntax
errors. During the execution phase, the DATA step writes
observations to the new data set.
Compilation Phase
At the beginning of the compilation phase, the program data vector is created.
This is the area of memory where data sets are built, one observation
at a time. Two automatic variables are also created: _N_
counts the number of DATA step executions, and _ERROR_
signals the occurrence of an error. DATA step statements are checked
for syntax errors, such as invalid options or misspellings.
Execution Phase
During the execution phase, each observation in the input data set is processed,
stored in the program data vector, and then
written to the new data set as an observation.
The DATA step executes once for each observation in the input data set, unless
otherwise directed.
Diagnosing Syntax Errors
Missing semicolons, misspelled keywords, and invalid options will cause
syntax errors in the compilation phase.
Detected errors are underlined and identified with a number and message in
the log. If SAS software can interpret a syntax error, the DATA step compiles
and executes; if SAS software cannot interpret the error, the DATA step compiles
but doesn't execute.
Diagnosing Execution-Time Errors
Illegal mathematical operations or processing a character variable as numeric
will cause
errors in the execution phase. Depending
on the type of error, the log may show a warning with invalid data from the
program data vector, and the DATA step may either stop or continue.
|