Adds the result of an expression to an accumulator variable
| Valid: |
in a DATA step
|
| Category: |
Action
|
| Type: |
Executable
|
-
variable
-
specifies the name of the accumulator variable,
which contains a numeric value.
-
expression
-
is any SAS expression.
The sum statement is equivalent to using the SUM function and
the RETAIN statement, as shown here:
retain variable 0;
variable=sum(variable,expression);
Here are examples of sum statements that illustrate
various expressions:
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.