&rem **** extract number of records &value -19 WKSP &openw %-19t$dir.lis DIR TABLE1 &closew &open %-19t$dir.lis error &read -1 error &read -1 error &close &extract -11 -1 2 & DEL %-19t$dir.lis SEL TABLE1 &rem **** set up cursor loop &sv -9 1 &label while RES $RECNO IN {%-9} MOVE CODE TO -1 &value -2 -1 1 %In the first part of the routine, the total number of records is determined by reading a DIR entry for TABLE1. TABLE1 is then selected, and each record reselected by $RECNO. The SML variable -1 is set equal to the value of CODE. Variable -4 is set equal to the value without the hyphen, and that value is substituted back into CODE.&value -3 -1 % &sv -4 %-2%-3 MOVE '%-4' TO CODE ASEL &cv -9 %-9 + 1 &goback while &if &rn %-9 1 %-11 &label end &return &rem **** I/O error trap &label error &type "I/O Error" &close &return