标题: n+1 [打印本页] 作者: shiyiming 时间: 2009-11-9 07:35 标题: n+1 in n+1statement, without remain, the n initial value is 0, 1, or missing? waiting online.Thanks!!!作者: shiyiming 时间: 2009-11-9 09:16 标题: Re: n+1 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.作者: shiyiming 时间: 2009-11-9 09:54 标题: Re: n+1 Thanks! got it.作者: shiyiming 时间: 2009-11-20 11:52 标题: Re: n+1 [code:2uwmbcg5]variable+expression; [/code:2uwmbcg5]
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]