楼主: gundamlf
4200 20

[原创博文] 在這情況,請教如何用解決呢?(急需coding!) [推广有奖]

21
shenliang_111 发表于 2011-8-21 09:30:00
data x;
input Race_number     Horse_code       Distance_ran     ;
cards;
1                               1                           1                              
5                               1                           1                              
14                             1                        1                           
250                           25                         1                              
260                           25                         4                              
310                           25                         4   
312                         25                         4   
;
data xxx;
do _n_=1 by 1 until(last.horse_code);
set x;
by horse_code;
if distance_ran=lag(distance_ran)
       then new_distance=1;
           else new_distance=0;
if _n_=1 then new_distance=0;
output;
end;
run;

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-27 07:06