jingju11 发表于 2012-4-19 21:32 
他的理解是对的。利用first.x是好的选择。京剧
后来想想其实 if first.a=1 or first.b=1 or first.c=1 then flag=1; 更简洁
proc sort data=temp1;
by a b c;
run;
data temp1;
set temp1;
by a b c;
if first.a=1 or first.b=1 or first.c=1 then flag=1;
else flag+1;
run;