When DATA step statements are compiled, SAS determines
whether to create an input buffer. If the input file contains raw
data (as in the example above), SAS creates an input buffer to hold
the data before moving the data to the program data vector (PDV).
(If the input file is a SAS data set, however, SAS does not create
an input buffer. SAS writes the input data directly to the PDV.)
The PDV contains all
the variables in the input data set, the variables created in DATA
step statements, and the two variables, _N_ and _ERROR_, that are
automatically generated for every DATA step. The _N_ variable represents
the number of times the DATA step has iterated. The _ERROR_ variable
acts like a binary switch whose value is 0 if no errors exist in the
DATA step, or 1 if one or more errors exist. The following figure
shows the Input Buffer and the program data vector after DATA step
compilation.
Variables that are created
by the INPUT and the Sum statements (TeamName, ParticipantName, Event1,
Event2, Event3, and TeamTotal) are set to missing initially. Note
that in this representation, numeric variables are initialized with
a period and character variables are initialized with blanks. The
automatic variable _N_ is set to 1; the automatic variable _ERROR_
is set to 0.
The variable TeamName
is marked Drop in the PDV because of the DROP= data set option in
the DATA statement. Dropped variables are not written to the SAS data
set. The _N_ and _ERROR_ variables are dropped because automatic variables
created by the DATA step are not written to a SAS data set. See
SAS Variables for details about
automatic variables.