|
Roger,
Read it again. :-)
When you do a CHKTAP it echo's back the volume id. You use that in your
INZTAP.
I wrote a command called CHKINZTAP that call's a CLP to do this.
/* Group Dekko Services, LLC */
/* */
/* This program will use CHKTAP to verify that the tape is loaded */
/* then it will use the volume id retrieved from the CHKTAP and */
/* use that on the INZTAP. */
/* */
/* Modification log: */
/* 01/03/03 by R.Berendt, CDP GDS,LLC */
/* Created */
/* 01/17/03 by R.Berendt, CDP GDS,LLC */
/* Changed INZTAP to CHECK(*YES) */
/* 04/28/03 by R.Berendt, CDP GDS,LLC */
/* Vary off/on tape drive in case backup immediately prior */
/* left drive in a failed state. */
/* 04/29/03 by R.Berendt, CDP GDS,LLC */
/* Changed INZTAP to CHECK(*NO) due to concerns regarding */
/* holidays, and inordinate amount of time for INZTAP. */
/* */
PGM ( +
&TAPEDRIVE /* Tape drive to process */ +
&STATUSCODE /* Status code: */ +
/* 0 = Success */ +
/* 50 = Vary off failed */ +
/* 51 = Vary on failed */ +
/* 52 = Invalid device status */ +
/* 100 = Generic CHKTAP failed */ +
/* 200 = Generic INZTAP failed */ +
)
DCL &MSG *CHAR 132 /* First level message text */
DCL &MSGDTA *CHAR 132 /* Message data */
DCL &MSGID *CHAR 7 /* Message id */
DCL &STATUSCODE *DEC 5 /* Status code: */ +
/* 0 = Success */ +
/* 50 = Vary off failed */ +
/* 51 = Vary on failed */ +
/* 52 = Invalid device status */ +
/* 100 = Generic CHKTAP failed */ +
/* 200 = Generic INZTAP failed */
DCL &TAPEDRIVE *CHAR 10 /* Tape drive to process */
DCL &VOLID *CHAR 14 /* Volume id of the tape */
CHGVAR VAR(&VOLID) VALUE(*BLANKS)
CHGVAR VAR(&STATUSCODE) VALUE(0)
/* +
| Check tape drive status +
*/
CALL PGM(CHKTAPSTS) PARM(&TAPEDRIVE &STATUSCODE)
If (&StatusCode = 0) Do
/* Valid device status */
/* +
| CHKTAP to retrieve the volume id, then use that to INZTAP. +
*/
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
MSGDTA('Checking tape volume') +
TOPGMQ(*EXT) MSGTYPE(*STATUS)
CHKTAP DEV(&TAPEDRIVE) ENDOPT(*REWIND)
MONMSG MSGID(CPF0000)
RCVMSG MSGQ(*PGMQ) MSG(&MSG) MSGDTA(&MSGDTA) MSGID(&MSGID) +
MSGTYPE(*LAST)
IF COND(&MSGID = 'CPC6778') THEN(DO) /* Volume &2 found +
on device &1. CHKTAP worked. */
CHGVAR VAR(&VOLID) VALUE(%SST(&MSGDTA 11 6))
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
MSGDTA('Initializing tape volume') +
TOPGMQ(*EXT) MSGTYPE(*STATUS)
INZTAP DEV(&TAPEDRIVE) NEWVOL(&VOLID) +
NEWOWNID(DEKKO) CHECK(*NO)
MONMSG MSGID(CPF0000) EXEC(DO) /* INZTAP failed */
CHGVAR VAR(&STATUSCODE) VALUE(200)
ENDDO /* INZTAP failed */
ENDDO /* CHKTAP worked */
ELSE CMD(DO) /* CHKTAP failed */
CHGVAR VAR(&STATUSCODE) VALUE(100)
ENDDO /* CHKTAP failed */
ENDDO /* Tape drive was either varied on, or abled to be varied off/on
*/
END:
ENDPGM
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.