Understanding DATA Step Processing |
Compilation
Phase |
As the INPUT statement is compiled, a slot is added to the program data vector for each variable in the input data set. Generally, variable attributes such as length and type are determined the first time that a variable is encountered. |
data perm.update; infile invent; input Item $ 1-13 IDnum $ 15-19 InStock 21-22 BackOrd 24-25; Total=instock+backord; run; |
Missing numeric values are represented by a period and missing character values are represented by a blank.
Any variables created in the DATA step are also added to the program data vector. For example, the assignment statement below creates the variable data perm.update; infile invent; input Item $ 1-13 IDnum $ 15-19 InStock 21-22 BackOrd 24-25; Total=instock+backord; run; |
At the bottom of the DATA step (in this example, when the RUN statement
is encountered), the compilation phase is complete and the descriptor
portion of the new SAS data set is created. The descriptor portion of
the data set includes:
|
Data Set Descriptor
|
At this point, the data set contains the five variables defined in the
input data set and assignment statement. Remember, _N_ and
_ERROR_ are not written to the data set. There are no observations
because the DATA step has not yet executed. During execution, each raw
data record is processed and then written to the data set as an observation. |
See the section on SAS variables in SAS Language Reference: Concepts for additional information on assigning attributes to variables. |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.