open "sort.txt" for output as #1
for j&=1 to 50000
nen$=right$( space$(3)+str$( SORTWORK1(J&, 2) ),3 )
kin&=1000000&-val( SORTWORK1(J&, 6) ) '金額は0〜999999(6桁)の場合
kin$=right$( space$(6)+str$( abs(kin$) ),6 )
print #1, nen$+kin$+right$( space$(5)+str$(j%),5 )
next j&
close #1
open "sort.out" for input as #1
while not eof(1)
line input #1, buf$
code&=val( right$( sortkey$(j&),5 ) )
for m=1 to 6
print SORTWORK1(code&, 6)
next m
wend