× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



CHKTAP should be sufficient instead of DSPTAP.  Your tape volume id's ARE
unique aren't they ?   ;-)

Here's part of my nightly backup job.

             DCL        VAR(&CHKTAP) TYPE(*LGL) VALUE('1') /* 1 = +
                          CHKTAP not run; 0 = CHKTAP already run */
             DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7)
             DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(100)
             DCL        VAR(&MSGKEY) TYPE(*CHAR) LEN(4)
             DCL        VAR(&TAPEDEV) TYPE(*CHAR) LEN(10) +
                          VALUE(TAP01) /* Device name defaulted to +
                          TAP01. */

/* CHECK THAT TAPE DRIVE IS READY WITH CORRECT TAPE.                 */
/*  (Volume ids for Nightly Backup tapes begin with:                 */
/*  DCMONn, DCTUEn, DCWEDn, DCTHUn, DCFRIn, DCSATn, DCSUNx (n=seq #).*/
CHKTAP:      CHKTAP     DEV(&TAPEDEV) ENDOPT(*REWIND)

             MONMSG     MSGID(CPF6708) /* Command ended due to error +
                          - possibly "CPF4120 Tape device +
                          equipment check" if tape from last nights +
                          backup sitting unloaded in drive with +
                          drive door open. */
             MONMSG     MSGID(CPF6718) /* Cannot allocate device. */
             MONMSG     MSGID(CPF6760) /* Device not ready. */
             MONMSG     MSGID(CPF6772) /* Volume cannot be processed */
             RCVMSG     MSGTYPE(*LAST) RMV(*NO) KEYVAR(&MSGKEY) +
                          MSGDTA(&MSGDTA) MSGID(&MSGID)

             IF         COND(&MSGID *EQ CPF6760) THEN(DO)
             SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> +
                          Tape device ' *CAT %SST(&MSGDTA 1 10) +
                          *TCAT ' was not ready.  Nightly backup +
                          job ended') TOUSR(*SYSOPR)
             GOTO       CMDLBL(BYPASS)
             ENDDO

             ELSE       CMD(DO)

             IF         COND(&MSGID *EQ CPF6708) THEN(DO)
/* If CHKTAP fails first time and we get a CPF6708 it may be caused  */
/*  by a CPF4168/MCH1668 and tape device may be in a FAILED state.   */
/*  Try once to vary off/on the tape device and retry CHKTAP.        */
              IF         &CHKTAP THEN(DO)
              CHGVAR     VAR(&CHKTAP) VALUE('0') /* CHKTAP run once */
              VRYCFG     CFGOBJ(&TAPEDEV) CFGTYPE(*DEV) STATUS(*OFF)
              MONMSG     MSGID(CPF2600) /* Ignore vary command error */
              DLYJOB     DLY(5)
              VRYCFG     CFGOBJ(&TAPEDEV) CFGTYPE(*DEV) STATUS(*ON)
              MONMSG     MSGID(CPF2600) /* Ignore vary command error */
              GOTO       CMDLBL(CHKTAP)
              ENDDO
             RCVMSG     MSGTYPE(*PRV) MSGKEY(&MSGKEY) RMV(*NO) +
                          MSGDTA(&MSGDTA) MSGID(&MSGID)
             SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> +
                          CHKTAP command ended due to error.  See +
                          message ' *CAT &MSGID *CAT ' in joblog.  +
                          Nightly backup job ended') TOUSR(*SYSOPR)
             GOTO       CMDLBL(BYPASS)
             ENDDO

             ELSE       CMD(DO)

             IF         COND(&MSGID *EQ CPF6718) THEN(DO)
             SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> +
                          Cannot allocate device ' *CAT +
                          %SST(&MSGDTA 1 10) *TCAT ' - in use by +
                          another job.  Nightly backup job ended') +
                          TOUSR(*SYSOPR)
             GOTO       CMDLBL(BYPASS)
             ENDDO

             ELSE       CMD(DO)

             IF         COND(&MSGID *EQ CPF6772) THEN(DO)
             SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>> Tape +
                          volume on device ' *CAT %SST(&MSGDTA 1 +
                          10) *TCAT ' cannot be processed.  Tape +
                          may be un-initialized, or initialized in +
                          an unsupported format or density.  +
                          Nightly backup job ended') TOUSR(*SYSOPR)
             GOTO       CMDLBL(BYPASS)
             ENDDO

             ELSE       CMD(DO)

             CHGVAR     VAR(&TAPVOLID) VALUE(%SST(&MSGDTA 11 6))

             IF         COND((&MSGID *EQ CPC6778) & +
                          (%SST(&MSGDTA 11 5) *NE 'DCMON') & +
                          (%SST(&MSGDTA 11 5) *NE 'DCTUE') & +
                          (%SST(&MSGDTA 11 5) *NE 'DCWED') & +
                          (%SST(&MSGDTA 11 5) *NE 'DCTHU') & +
                          (%SST(&MSGDTA 11 5) *NE 'DCFRI') & +
                          (%SST(&MSGDTA 11 5) *NE 'DCSAT') & +
                          (%SST(&MSGDTA 11 5) *NE 'DCSUN')) THEN(DO)
             SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> +
                          Tape volume ' *CAT &TAPVOLID *TCAT ' +
                          found on device ' *CAT %SST(&MSGDTA 1 10) +
                          *TCAT ' - not a 1/4" Nightly Backup tape +
                          (volid starting with "DC" + first 3 +
                          letters of day of week).  Nightly backup +
                          job ended') TOUSR(*SYSOPR)
             GOTO       CMDLBL(BYPASS)
             ENDDO
             ENDDO

             ENDDO
             ENDDO
             ENDDO



...Neil





"Jim Langston" <jlangston@celsinc.com>
Sent by: midrange-l-admin@midrange.com
2001/09/24 12:46
Please respond to midrange-l


        To:     <midrange-l@midrange.com>
        cc:
        Subject:        DSPTAP takes too long


I've been given the task to write something to start checking the tape in
our tape drive around 7:00 in the morning and start sending a message
every
hour until the tape is changed.

Not a difficult task, it would seem, simply do a DSPTAP, get a file
date/time or tape date/time and save the value, and compare every hour
until
it changes.

I do a DSPTAP to an outfile, and it takes quite a long time to complete
(over half hour).  I tried to see if I can just get the first label, but
with outfile it starts at the label number you specify.

So... my question is, are there any tap APIs I could use that could
perhaps
be faster?  Just allow me to grab the beginning tape information as that's
all I need.

Thanks in advance,

Jim Langston






As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.