      SUBROUTINE OFILES(IERROR)
      COMMON/PLT/DUMMY1(20),IDAT,IPL2,IPLT,IDFL
      COMMON/STRESS/IFLOK
      COMMON/IFORMT/IFORM
      COMMON/NSAP6/ISAP6
      COMMON/WHICHF/IB,LO
      IPLT=0
      READ(31,10,ERR=100,END=100)IDOMY
10    FORMAT(A4)
      IFORM=1
      REWIND 31
19    READ(34,22,ERR=23,END=23)IDOMY
22    FORMAT(I5)
      REWIND 34
      IF(IDOMY.LT.-5)GO TO 23
      IB=1
      GO TO 15
23    IB=0
15    READ(33,22,ERR=25,END=25)IDOMY
      REWIND 33
      IF(IDOMY.LT.-5)GO TO 25
      IPLT=33
      GO TO 30
25    IDFL=0
30    READ(35,22,ERR=40,END=40)IDOMY
      REWIND 35
      IF(IDOMY.LT.-5)GO TO 40
      IFLOK=1
77    ISAP6=0
      GO TO 50
40    IFLOK=0
      GO TO 77
50    READ(32,22,ERR=60,END=60)IDOMY
      REWIND 32
      IF(IDOMY.LT.-5)GO TO 60
      ISAP6=1
      IDFL=32
60    RETURN
100   IERROR=1
      RETURN
      END
