Deriving tape header info for use in logging and messaging

Tags:
Application development
AS/400
Backup and Recovery
DataCenter
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Molzep
    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 pointsBadges:
    report
  • Machsite
    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)
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following