      SUBROUTINE DKBFCL(IH,IB,ISTAT)
C     CLOSE THE FILE AFTER DUMPING BUFFER
C
      INTEGER IB(2058)
C
C     CHECK FOR WRITE BUFFER
C
      IF(IB(6).LT.0) THEN
C
C     CHECK FOR NON-EMPTY BUFFER
C
      IF(IB(5).GT.IB(4)) THEN
      N= IB(5) - IB(4)
      CALL WRITF(IH,IB(IB(2)), N, ISTAT, NTT)
      IF(N.NE.NTT) THEN
      ISTAT=-1
      RETURN
      ENDIF
      ENDIF
      ENDIF
      IB(1)=0
      CALL CLOSF(IH,ISTAT)
      RETURN
      END
