      PROGRAM HLPSET
C
      CHARACTER*66 LINE
      OPEN(UNIT=9,FILE='HELP',ACCESS='SEQUENTIAL',STATUS='OLD')
      OPEN(UNIT=1,FILE='MATHELP.DAC',
     .     STATUS='NEW',ACCESS='DIRECT',RECL=66)
      OPEN(UNIT=2,FILE='MATHELP.IDX',
     .     STATUS='NEW',ACCESS='DIRECT',RECL=8)
      REWIND 9
      N = 0
      K = 0
   10 READ(9,12,END=20) LINE
   12 FORMAT(A66)
      N = N + 1
      WRITE(1,REC=N) LINE
      IF (LINE(1:4) .NE. '    ') THEN
         K = K + 1
         WRITE(2,REC=K) LINE(1:4),N
      ENDIF
      IF (LINE(1:4) .NE. 'EOF ') GO TO 10
   20 CLOSE(1)
      CLOSE(2)
      END