      PROGRAM DETJOB
C
C     N. A. Bourgeois, Jr.    23-Feb-88/.
C
C Detach a job, check its status, and then kill it.
C
      LOGICAL*1 JOBNAM(14)
C
      CALL SCOPY ('SY SNOOPYCOM',JOBNAM,12)
      CALL STDTJB (JOBNAM,JOBNUM,IERR)
      IF (IERR .EQ. 1) STOP 'No detached line available'
          TYPE *,'Job number is:',JOBNUM
          ISTAT = ISTDJ (JOBNUM)
          IF (ISTAT .EQ. 0) STOP 'Job is not active'
              CALL KLDTJB (JOBNUM)
              DO 100 I = 1,16384
                  IDELAY = IDELAY + I
  100         CONTINUE
              ISTAT = ISTDJ (JOBNUM)
              IF (ISTAT .EQ. 1) STOP 'Job is still active'
              TYPE *
C
              CALL EXIT
              END
