C  This program illustrates the use of the err =
C  FORTRAN had a rudimentary form of error handling
      INTEGER S
      WRITE (6,35)
C     read line of text
      READ (5,36,ERR = 29) S
C     print line of text

      WRITE (6,37) S
      GO TO 40
29    WRITE (6, 20)

20    FORMAT (1X, ' HAD AN ERROR IN THE INPUT DATA ')
35    FORMAT (1x, ' Please enter AN INTEGER ')
36    FORMAT (i5)
37    FORMAT (I5)
40    STOP
      END

