一、组内
data temp1;
set temp;
by id;
gid+1;
if first.id then gid=1;
run;
二、组间
data Mainminus_match1;
set Mainminus_match;
by erwei ;
if first.erwei then indus+1;
run;
data temp1;
set temp;
by id;
gid+1;
if first.id then gid=1;
run;
data Mainminus_match1;
set Mainminus_match;
by erwei ;
if first.erwei then indus+1;
run;