        SUBROUTINE CTOI2(S,N,I,J)
C               TJP 1977 DECEMBER 4  CIT 370/158
C               MODIFIED 1979 FEB 5  VAX/VMS FORTRAN 4
C               MODIFIED 1989 MAY 26 CONV. FR. FUNCT. TO SUBROUTINE
C
C               EVALUATE INTEGER AT S(I); INCREMENT I
C
        INTEGER*4 J,N,I
        INTEGER*2 S(N),DIGITS(10)
        CHARACTER*2 CDIGIT(10)
        EQUIVALENCE (CDIGIT(1),DIGITS(1))
        DATA      CDIGIT/'0','1','2','3','4','5','6','7','8','9'/
C
        J=0
   10   IF(I.GT.N) RETURN
        DO 20 K=1,10
        IF(S(I).EQ.DIGITS(K)) GOTO 30
   20   CONTINUE
        RETURN
   30   J=J*10+K-1
        I=I+1
        GOTO 10
        END
