C  This program illustrates the use of the err =
C  FORTRAN had a rudimentary form of error handling
      INTEGER S
      WRITE (6,35)
35    FORMAT (1x, ' Please enter AN INTEGER ')
C     read line of text
      READ (5,36,ERR = 29) S
36    FORMAT (i5)
C     print line of text
      WRITE (6,37) S
37    FORMAT (I5)
29    WRITE (6, 20)
20    FORMAT (1X, ' HAD AN ERROR IN THE INPUT DATA ')
      STOP
      END

