|
This bit of code from my nightly backup illustrates the point - DCL's missing. It includes a bunch of other tests too, so snip out the bits you don't want (or maybe you do want them and didn't realize it :-) : /* CHECK THAT TAPE DRIVE IS READY WITH CORRECT TAPE. */ CHKTAP DEV(&TAPEDEV) ENDOPT(*REWIND) MONMSG MSGID(CPF6708) /* Command ended due to error + - most likely "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) 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')) 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 << Gi-normous SNIP >> /* BRANCH HERE IF ERRORS DURING SAVE OPERATIONS. */ ERROR: RCVMSG MSGTYPE(*LAST) RMV(*NO) KEYVAR(&MSGKEY) + MSGDTA(&MSGDTA) MSGID(&MSGID) IF COND(&MSGID = CPF4110) THEN(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> + Cancel reply received for message ' *CAT + %SST(&MSGDTA 65 7) *CAT ' - Tape device ' + *CAT %SST(&MSGDTA 31 10) *TCAT ' not + ready. Nightly backup job ended') + TOUSR(*SYSOPR) SNDDST TYPE(*MSG) TOUSRID((&WARNUSER1 &WARNADDR1) + (&WARNUSER2 &WARNADDR2)) DSTD('Message re + nightly backup job.') MSG('>>> Cancel + reply received for message ' *CAT + %SST(&MSGDTA 65 7) *CAT ' - Tape device ' + *CAT %SST(&MSGDTA 31 10) *TCAT ' not + ready. Nightly backup job ended') PTY(*HIGH) RCVMSG MSGTYPE(*PRV) MSGKEY(&MSGKEY) RMV(*NO) + MSGDTA(&MSGDTA) MSGID(&MSGID) ENDDO IF COND((&MSGID = CPF3794) & (%SST(&MSGDTA 1 7) + = 'CPF5101')) THEN(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> + Error on device' *BCAT &TAPEDEV *TCAT '. + Nightly backup job ended') TOUSR(*SYSOPR) SNDDST TYPE(*MSG) TOUSRID((&WARNUSER1 &WARNADDR1) + (&WARNUSER2 &WARNADDR2)) DSTD('Message re + nightly backup job.') MSG('>>> Error on + device' *BCAT &TAPEDEV *TCAT '. Nightly + backup job ended') PTY(*HIGH) GOTO CMDLBL(BYPASS) ENDDO IF COND((&MSGID = CPF3794) & (%SST(&MSGDTA 1 7) + = 'CPF5270')) THEN(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> Tape + device' *BCAT &TAPEDEV *TCAT ' dropped + ready status. Nightly backup job ended') + TOUSR(*SYSOPR) SNDDST TYPE(*MSG) TOUSRID((&WARNUSER1 &WARNADDR1) + (&WARNUSER2 &WARNADDR2)) DSTD('Message re + nightly backup job.') MSG('>>> Tape + device' *BCAT &TAPEDEV *TCAT ' dropped + ready status. Nightly backup job ended') GOTO CMDLBL(BYPASS) ENDDO IF COND((&MSGID = CPF3794) & (%SST(&MSGDTA 1 7) + = 'CPF8105')) THEN(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> Tape + device description' *BCAT &TAPEDEV *TCAT + ' damaged. Nightly backup job ended') + TOUSR(*SYSOPR) SNDDST TYPE(*MSG) TOUSRID((&WARNUSER1 &WARNADDR1) + (&WARNUSER2 &WARNADDR2)) DSTD('Message re + nightly backup job.') MSG('>>> Tape + device description' *BCAT &TAPEDEV *TCAT + ' damaged. Nightly backup job ended') GOTO CMDLBL(BYPASS) ENDDO IF COND((&MSGID = CPF3794) & (%SST(&MSGDTA 1 7) + = 'CPF5349')) THEN(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> + Media error on volume' *BCAT &TAPVOLID + *TCAT ' mounted in device' *BCAT &TAPEDEV + *TCAT '. Nightly backup job ended') + TOUSR(*SYSOPR) SNDDST TYPE(*MSG) TOUSRID((&WARNUSER1 &WARNADDR1) + (&WARNUSER2 &WARNADDR2)) DSTD('Message re + nightly backup job.') MSG('>>> Media + error on volume' *BCAT &TAPVOLID *TCAT ' + mounted in device' *BCAT &TAPEDEV *TCAT + '. Nightly backup job ended') GOTO CMDLBL(BYPASS) ENDDO IF COND(&MSGID = CPF3794) THEN(DO) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('>>> Save + operation ended unsuccessfully - see + message ' *CAT %SST(&MSGDTA 1 7) *CAT ' + in the job log for job ' *CAT &JOB *BCAT + &USER *BCAT &NBR *CAT '. Nightly backup + job ended') TOUSR(*SYSOPR) SNDDST TYPE(*MSG) TOUSRID((&WARNUSER1 &WARNADDR1) + (&WARNUSER2 &WARNADDR2)) DSTD('Message re + nightly backup job.') MSG('>>> Save + operation ended unsuccessfully - see + message ' *CAT %SST(&MSGDTA 1 7) *CAT ' + in the job log for job ' *CAT &JOB *BCAT + &USER *BCAT &NBR *CAT '. Nightly backup + job ended') GOTO CMDLBL(BYPASS) ENDDO GOTO CMDLBL(BYPASS) ENDPGM Neil Palmer AS/400~~~~~ NxTrend Technology - Canada ____________ ___ ~ Thornhill, Ontario, Canada |OOOOOOOOOO| ________ o|__||= Phone: (905) 731-9000 x238 |__________|_|______|_|______) Cell.: (416) 565-1682 x238 oo oo oo oo OOOo=o\ Fax: (905) 731-9202 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mailto:NPalmer@NxTrend.com AS/400 The Ultimate Business Server http://www.NxTrend.com > -----Original Message----- > From: Chuck Lewis [SMTP:CLEWIS@IQUEST.NET] > Sent: Thursday, July 30, 1998 3:33 PM > To: MIDRANGE-L@midrange.com > Subject: Checking for tape Volume Identifier in a CL > > Hi Folks, > > I know I have seen this in the past, in a book or article or > something; > even made a note of it but of COURSE I can't find the note now... > > What is the method for checking a tapes volume id in a CL ? > > I thought you could use the CHKTAP command but I don't remember the > way > to have the CL receive the information that this command returns via > the > message it sends. > > Thanks ! > > Chuck > +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
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.