0 pts.
 Deriving tape header info for use in logging and messaging
I would like an example, preferably in i5/OS CL, for a method to retreive the volume number of the tape just used for a complete system backup so that I can put out a message to the system operator queue or the system log which includes the tape volume number. I tried this with CHKTAP which puts it out to the job log, but the joblog for the complete save is thousands of pages and I would like to make it easier to find.

Software/Hardware used:
ASKED: December 13, 2006  3:08 PM
UPDATED: December 15, 2006  10:52 AM
  Help
 Approved Answer - Chosen by TomLiotta

Using CHKTAP... Add this to the end of your Save

First declare...
DCL VAR(&VOLNAM) TYPE(*CHAR) LEN(6)
DCL VAR(&MSG) TYPE(*CHAR) LEN(80)
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)

CHKTAP DEV(TAP01) ENDOPT(*REWIND)
NEWMSG: RCVMSG RMV(*NO) MSG(&MSG) MSGID(&MSGID)
IF COND(&MSGID *EQ CPC6778) THEN(DO)
CHGVAR VAR(&VOLNAM) VALUE(%SST(&MSG 8 6))
SNDMSG +
MSG('Save completed on volume' +
*BCAT &VOLNAM) TOUSR(QSYSOPR)
ENDDO
GOTO CMDLBL(NEWMSG)

ANSWERED:  Dec 15, 2006  10:52 AM (GMT)  by TomLiotta

 
Other Answers:

Try this command:

DSPTAP DEV(TAP01) SEQNBR(1 1) OUTPUT(*PRINT)

It should give you what you’re looking for. You can also output it to a file if you prefer that.

Last Wiki Answer Submitted:  December 14, 2006  7:40 am  by  Vatchy   1,410 pts.
Latest Answer Wiki Contributors:  Vatchy   1,410 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Try this:

DCLF FILE (QTEMP/A)
DSPTAP DEV(TAP01) SEQNBR(*FIRST *LAST) +
OUTPUT(*OUTFILE) OUTFILE(QTEMP/A)
READ: RCVF
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(END))
SNDMSG MSG(‘Backup completed on volume ‘ *CAT +
&RDVOLL) TOUSR(QSYSOPR)
GOTO READ
END: ENDPGM

 0 pts.