data max;
do obsnum= 1 to 8 by 2;
set raw point=obsnum;
if _error_ then abort;
end;
stop;
run;作者: shiyiming 时间: 2006-1-20 10:57 标题: to maurice 程序没有错误,Max里没有记录是因为第二个data步里没有output语句。
我不知道你想干什么,猜想你是想求第一个数据集里con的最大值。所以我改了代码,你看看是你想要得吗?
[code:f41f4]data max(keep=max_con);
set raw nobs=nobs;
do obsnum=1 to nobs;
set raw point=obsnum;
if con>max then max=con;
if _error_ then abort;
end;
max_con=max;
output;
stop;
run;[/code:f41f4]作者: shiyiming 时间: 2006-1-22 14:03 标题: 谢谢管理员 谢谢管理员!
我正是此意,被君一眼看破!
不过我对你的程序还有点不明白。
set raw nobs=nobs;是什么意思?
书上说:nobs= 是产生一个临时变量存储数据集中的观测数量。那么有一点我没弄明白,比如nobs=x,究竟是将x的值赋给nobs,还是将nobs的值赋给x?作者: shiyiming 时间: 2006-1-23 14:43 标题: to maurice <!-- l --><a class="postlink-local" href="http://www.mysas.net/forum/viewtopic.php?t=1543">viewtopic.php?t=1543</a><!-- l -->