
31Understanding How the DATA Step Works
The SUM statement may seem unusual because it does not contain the equal
sign. In the SUM statement, variable is the numeric accumulator variable that
is to be created and is automatically set to 0 at the beginning of the rst itera-
tion of the DATA step execution (and is thus retained in following iterations).
Expression is any SAS expression. In a situation where expression is evaluated
to a missing value, it is treated as 0. Program 3.4 is an equivalent version of
Program 3.3 using the SUM statement.
Program 3.4:
data ex3_3;
set sas3_1;
total + score;
run;
FIGURE 3.6
The second iteration of Program 3.3. ...