Creating and Modifying Variables
It is often useful to create a variable that accumulates the values of another variable.
Suppose you want to create the data set Clinic.Stress and to add a new variable, SumSec, to accumulate the total number of elapsed seconds in treadmill stress tests.
Clinic.Stress Data Set
To add the result of an expression to an accumulator variable, you can use a sum statement in your DATA step.
General form, sum statement: