      SUBROUTINE OPNINC(IERROR,MEMBER,SRCDIR,INCDIR)
C
      IMPLICIT INTEGER(A-Z)
C
      PARAMETER ( MXFILL = 512 )
      PARAMETER ( MXMEML = 256 )
      CHARACTER*(MXFILL) SRCDIR
      CHARACTER*(MXFILL) INCDIR
      CHARACTER*(MXFILL) INCSTR
C
      CHARACTER*(MXMEML)  MEMB
      CHARACTER*(MXMEML)  MEMBER
C
C
      CHARACTER*60   MESSAG
C=======================================================================
C
C
      PARAMETER (MXLVL=16)
      CHARACTER*132  CARD
      CHARACTER*256  STACKM
      COMMON/CRDXXX/ CARD  ,STACKM(MXLVL)
      COMMON/CRDYYY/ ISNX  ,ICRDXX,
     *               CRDEND,INIT  ,OPTION,
     *               INCUNT,LVL   ,STACKI(3,MXLVL)
C
C=======================================================================
C
      CHARACTER*1        WINDIR
      CHARACTER*20       ATIME
      CHARACTER*20       CTIME
      CHARACTER*20       MTIME
      CHARACTER*10       TDATE
C
      WINDIR = CHAR(92)
C
      IERROR = 0
C
      IF ( LVL .LT. MXLVL )
     *   THEN
            LVL           = LVL + 1
            STACKM(  LVL) = MEMBER
            STACKI(1,LVL) = CRDEND
            STACKI(2,LVL) = INIT
            STACKI(3,LVL) = OPTION
C
            CRDEND = 0
            INIT   = -2
            OPTION = 0
C
            IF ( INCDIR .NE. ' ' ) THEN
               INCSTR = INCDIR
            ELSE
               INCSTR = SRCDIR
            END IF
C
            IF ( INCSTR .EQ. ' ' ) THEN
               MEMB = MEMBER
            ELSE IF (       INCSTR .EQ. './'
     *                .OR.  INCSTR .EQ. '.'//WINDIR ) THEN
               MEMB = MEMBER
            ELSE IF ( INCSTR .EQ. '.' ) THEN
               MEMB = MEMBER
            ELSE
C
               DO 100 I = MXFILL , 1 , -1
                  IF ( INCSTR(I:I) .NE. ' ' ) THEN
                     IF (       INCSTR(I:I) .EQ. '/'
     *                    .OR.  INCSTR(I:I) .EQ. WINDIR
     *                    .OR.  INCSTR(I:I) .EQ. ':' ) THEN
                        MEMB = INCSTR(1:I)//MEMBER
                     ELSE
                        MEMB = INCSTR(1:I)//'/'//MEMBER
                     END IF
                     GO TO 200
                  END IF
  100          CONTINUE
               MEMB = MEMBER
  200          CONTINUE
C
            END IF
C
C
C
            CALL ISSTAT(IERROR,MXMEML,MEMB  ,IFTYPE,IFSIZE,
     &                  IREAD ,IWRITE,IEXEC ,
     &                  ATIME ,CTIME ,MTIME )
            IF (       IERROR .NE. 0
     &           .OR.  IFTYPE .NE. 0 )THEN
               IERRMS = 2
               CALL ERRORM(IERRMS,MXMEML,MEMB  )
               IERROR = 1
               RETURN
            END IF
C
C
            INCUNT   = INCUNT + 1
            CALL FLOPEN(IERR,MESSAG,INCUNT,'FT11F001','R')
            IF ( IERR .GT. 0  )
     *         THEN
                  WRITE(6,20200) LVL
                  CALL STATUS
                  STOP 100
               END IF
            CALL FLFIND(IERR,MESSAG,INCUNT,MEMB  )
            IF ( IERR .GT. 0  )
     *         THEN
                  WRITE(6,20300) MEMB
                  CALL STATUS
                  STOP 100
            END IF
         ELSE
            WRITE(6,20100) MXLVL
            CALL STATUS
            STOP 100
      END IF
      RETURN
C
C
20100 FORMAT(1H1///
     *       1H ,'ERROR:INCLUDE NEST LEVEL IS OVER MAXIMUM LEVEL ',I5)
20200 FORMAT(1H1///
     *       1H ,'ERROR:INCLUDE FILE OPEN ERROR.  LEVEL ',I5)
20300 FORMAT(1H1///
     *       1H ,'ERROR:INCLUDE MEMBER NOT FOUND.       ',A )
      END
