C***   A1TOA5

       SUBROUTINE A1TOA5(CHARS,CINDEX,WDS,PUNC)

       IMPLICIT INTEGER(A-Z)
       LOGICAL  PUNCT
       DIMENSION CHARS(70),WDS(2)
      REAL*8 WDS,WDUMY(1)
       DATA SPACE,COMMA,PERIOD,SEMICO /' ',',','.',';'/
      DATA LOWERA,LOWERZ/'a','z'/  /* THOSE ARE LOWER CASE!

       PUNCT(CHAR)=CHAR.EQ.SPACE.OR.CHAR.EQ.COMMA.OR.CHAR.EQ.SEMICO
     1  .OR.CHAR.EQ.PERIOD.OR.CHAR.EQ.0

       WDS(1)=' '
       WDS(2)=' '

       DO 2 CINDEX=CINDEX,70
       IF(.NOT.PUNCT(CHARS(CINDEX)))GOTO 4
       IF(CHARS(CINDEX).EQ.0)GOTO 8
2       CONTINUE
       PUNC=0
       RETURN

4     DO 10 I=CINDEX,70
      IF(PUNCT(CHARS(I)))GOTO 8
      IF(CHARS(I).GE.LOWERA.AND.CHARS(I).LE.LOWERZ)
     1   CHARS(I)=AND(CHARS(I),:157777)
10    CONTINUE
      ENCODE(16,101,WDS)(CHARS(I),I=CINDEX,70)
      PUNC=0
      CINDEX=71
      RETURN
8     PUNC=CHARS(I)
      FINISH=I-1
      ENCODE(16,101,WDS)(CHARS(J),J=CINDEX,FINISH)
      CINDEX=I
      RETURN
101   FORMAT(2(6A1,2X))
       END
