Check expiry date of tape (using iSeries and BRMS)

15 pts.
AS/400 Control Language
Backup Recovery and Media Services
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.



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..


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.
  • 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:
  • PierreLG
    Hello Garry,

    I would be interested to see your Query definition.
    Could you share it?

    70 pointsBadges:

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.

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


Share this item with your network: