Code:
- /* Group Dekko Services, LLC */
- /* ALL RIGHTS RESERVED. */
- /* */
- /* 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. */
- /* 02/01/07 by R.Berendt, CDP GDS,LLC */
- /* Change to default density of *DEVTYPE to *CTGTYPE */
- /* */
- 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) DENSITY(*CTGTYPE)
- 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
|
|