其中holdday计算规则:
if cjsl>0 and sysl-cjsl=0 then holdday=0
if cjsl>0 and sysl-cjsl>0 then holdday=(sysl-cjsl)*(上一条记录的holdday+本次与上条记录距离之间的rq差)/sysl
if cjsl<=0 then holdday=上一条记录的holdday+本次与上条记录距离之间的rq差
data b(drop=lag_rq);
set a;
lag_rq=lag(rq);
retain holdday 0;
if cjsl>0 and sysl-cjsl=0 then holdday=0;
else if cjsl>0 and sysl-cjsl>0 then holdday=(sysl-cjsl)*(holdday+rq-lag_rq)/sysl;
else if cjsl<=0 then holdday+rq-lag_rq;
run;
proc print;run;[/code:632vtnym]
只要将输入时间的格式改一下就可以了。作者: shiyiming 时间: 2008-6-6 21:34 标题: Re: 请教各位大大一个问题 呵呵。我昨晚看懂了程序,稍微改了一下。不过对您的帮助真的非常感谢。