Check expiry date of tape (using iSeries and BRMS)

15 pts.
Tags:
AS/400 Control Language
Backup Recovery and Media Services
BRMS
CL
Expired tapes
IBM iSeries
iSeries backup
Tape backup
I am chasing a simple CL program to check if the currently loaded tape has the data as *expired so it can be written to under BRMS. It shouldn't be that hard but I've searched for literally days and can't find anyone to help.

Answer Wiki

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

I’m not sure if there’s a better solution with BRMS since I haven’t used it, but here’s a quick off the cuff idea –

You could direct the output of the DSPTAP command to an output file, and then read that file in the CL to see what the expiration date of the file(s) on the tape is – then you could proceed accordingly.

CWC

———————————–

First off – BRMS woun’t use the volume if it is not expired.. If you are running a library, you just need to make sure you have expired tapes in the lib..

But, if you really want to check the BRMS database – <b>QUSRBRM / QA1AMM</b> is the file you probably want to look at.. Select records where the “Vault” is your tape device and that should give you what you want..

Regards
Mike

Discuss This Question: 1  Reply

 
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
  • GarryS
    Thanks for the responses. Unfortunately BRMS tags ALL files as *perm expiry and keeps track of the tape expiration date in the file QUSRBRM/QAIAMM. This means that a DSPTAP can't display the expiry date. I thought about writing to the tape to verify it could accept data. The problem was that you had to add at least one day the the current retention date effectively un-expiring the tape. I did manage to build a solution - thanks to other contributers who snippets of code I borrowed. /* Run a query over file QAIAMM and extract a list of all BRMS media with */ /* expired flag = Y. Insert each Vol_id into file BRMSEXP. Get the Vol-id */ /* of the currently loaded tape and compare to each Vol_id in file BRMSEXP */ /* If no match is found then the media is not expired so generate an error */ PGM DCL VAR(&VOLNAME) TYPE(*CHAR) LEN(6) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(300) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&REPLY) TYPE(*CHAR) LEN(1) DCLF FILE(GARRYS/BRMSEXP) /* Query BRMS file QA1AMM to load new file BRMSEXP with vol-ids of exp media */ RUNQRY QRY(GARRYS/BRMSEXP) QRYFILE((*SAME)) /* Get Vol_id of currently loaded tape on TAP01 */ CHKTAP DEV(TAP01) RCVMSG MSGTYPE(*LAST) RMV(*NO) MSGDTA(&MSGDTA) MSGID(&MSGID) IF (&MSGID *NE 'CPC6778') THEN(DO) SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) + MSGDTA('Unable to retrieve Volume_Id!') ENDDO CHGVAR VAR(&VOLNAME) VALUE(%SST(&MSGDTA 11 6)) /* Compare Currently loaded Vol_id to list of BRMS expired media */ LOOP: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO EOF) IF (&TMCVSR *EQ &VOLNAME) DO SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA+ ('Loaded volume ' *CAT &TMCVSR *CAT 'is Expired') + TOUSR(*SYSOPR) MSGTYPE(*INFO) GOTO END ENDDO GOTO LOOP EOF: SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Tape loaded + is NOT expired - Action required!') + TOUSR(*SYSOPR) MSGTYPE(*INQ) END: ENDPGM
    15 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