SET ORDER TO &t_km
GO top
t_mc=1
t_mc1=1
t_cj=&t_km
replace &t_km.mc with 1
SKIP
DO while not EOF()
t_mc1=t_mc1+1
IF &t_km<t_cj
t_mc=t_mc1
t_cj=&t_km
ENDIF
replace &t_km.mc with t_mc
SKIP
ENDDO
sele km
skip
endd
sele cj31
use
sele km
use
SET ORDER TO &t_km
GO top
t_mc=1
t_mc1=1
t_cj=&t_km
replace &t_km.mc with 1
SKIP
DO while not EOF()
t_mc1=t_mc1+1
IF &t_km<t_cj
t_mc=t_mc1
t_cj=&t_km
ENDIF
replace &t_km.mc with t_mc
SKIP
ENDDO
sele km
skip
endd
sele cj31
use
sele km
use