SAS 9.1的Help Document中SUM Statement有关于这个的解释。
The variable is automatically set to 0 before SAS reads the first observation. The variable's value is retained from one iteration to the next, as if it had appeared in a RETAIN statement.
is equivalent to using the SUM function and the RETAIN statement, as shown here:
[code:2uwmbcg5]
retain variable 0;
variable=sum(variable,expression);[/code:2uwmbcg5]