BRMS - restore library/object from expired tape

By kimot, 25 December, 2022

If you want to restore some library/objects into your system. But unfortunately there is any information in BRMS. Little hope remains, that library/objects is still available in some tape marked in BRMS as *EXP (expired).

You can run DSPTAP on *EXP tapes, but it could be very long process. Better way is to find out specific tape containing desired library/object. If you have old backups of QUSRBRM library in BRMS, you are lucky. Restore object QUSRBRM/QA1AHS from the period when the library/object was backed up.

Then run this SQL:

SELECT *            
FROM QA1AHS 
WHERE bkhlbl = 'expired_library'
ORDER BY Bbkhsvt DESC ;   

There should be Volume name (BKVOL) and Sequence number (BKHSEQ) required for RSTOBJ or RSTLIB command.

If sequence number (BKHSEQ) contain "9999" you have tu run

DSPTAP DEV(TAPE) OUTPUT(*PRINT)

and then find out sequence number on spool file.

Once you have Volume name and Sequence number you can run command like this :

RSTOBJ OBJ(object_name) SAVLIB(library_name) 
DEV(tape) OBJTYPE(*FILE) SEQNBR(sequence_number) 
MBROPT(*ALL) STRJRN(*NO) ALWOBJDIF(*ALL) RSTLIB(restore_to_library)