|
I use a command RSTLIBALL that will restore everything from a tape - if that isn't enough you should be able to adapt it..... PGM PARM(&DEV) DCL VAR(&DEV) TYPE(*CHAR) LEN(10) DCL VAR(&SEQ) TYPE(*DEC) LEN(4) VALUE(1) DCL VAR(&SEQA) TYPE(*CHAR) LEN(4) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) /**********************************************************************/ /* Global Error Handler /**********************************************************************/ DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(200) DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&JOB) TYPE(*CHAR) LEN(10) DCL VAR(&USER) TYPE(*CHAR) LEN(10) DCL VAR(&INTER) TYPE(*CHAR) LEN(1) DCL VAR(&NBR) TYPE(*CHAR) LEN(6) DCL VAR(&JOBDETS) TYPE(*CHAR) LEN(40) DCL VAR(&DATE) TYPE(*CHAR) LEN(6) DCL VAR(&DATESEP) TYPE(*CHAR) LEN(8) DCL VAR(&TIME) TYPE(*CHAR) LEN(6) DCL VAR(&TIMESEP) TYPE(*CHAR) LEN(8) MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR)) RTVJOBA JOB(&JOB) USER(&USER) NBR(&NBR) TYPE(&INTER) RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DATE) RTVSYSVAL SYSVAL(QTIME) RTNVAR(&TIME) CVTDAT DATE(&DATE) TOVAR(&DATESEP) CHGVAR VAR(&TIMESEP) VALUE(&TIME) CHGVAR VAR(&JOBDETS) VALUE(&JOB *CAT &USER *CAT &NBR + *CAT &DATESEP *CAT &TIMESEP) /**********************************************************************/ CHKTAP DEV(&DEV) SEQNBR(*NONE) ENDOPT(*REWIND) RPT: CHGVAR VAR(&SEQA) VALUE(&SEQ) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Getting + library name for File Seq ' *CAT &SEQA) + TOPGMQ(*EXT) MSGTYPE(*STATUS) RMVMSG MSGQ(*PGMQ) CLEAR(*ALL) CHKTAP DEV(&DEV) SEQNBR(&SEQ) ENDOPT(*LEAVE) MONMSG MSGID(CPF0000) EXEC(DO) IF COND(&SEQ = 1) THEN(SNDPGMMSG MSGID(CPF9898) + MSGF(QCPFMSG) MSGDTA('Device ' *CAT &DEV + *TCAT ' does not contain any libraries')) GOTO CMDLBL(QUIT) ENDDO /* Get the last 3 messages to find the CHKTAP completion message CPC6779 */ RCVMSG MSGQ(*PGMQ) MSGTYPE(*COMP) MSGDTA(&MSGDTA) + MSGID(&MSGID) IF COND(&MSGID *EQ 'CPC6779') THEN(GOTO FOUNDSEQ) RCVMSG MSGQ(*PGMQ) MSGTYPE(*COMP) MSGDTA(&MSGDTA) + MSGID(&MSGID) IF COND(&MSGID *EQ 'CPC6779') THEN(GOTO FOUNDSEQ) RCVMSG MSGQ(*PGMQ) MSGTYPE(*COMP) MSGDTA(&MSGDTA) + MSGID(&MSGID) IF COND(&MSGID *EQ 'CPC6779') THEN(GOTO FOUNDSEQ) FOUNDSEQ: CHGVAR VAR(&LIB) VALUE(%SST(&MSGDTA 27 10)) SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) + MSGDTA('Restoring Library ' *CAT &LIB) + TOPGMQ(*EXT) MSGTYPE(*STATUS) RSTLIB SAVLIB(&LIB) DEV(&DEV) ENDOPT(*LEAVE) MONMSG MSGID(CPF0000) RCVMSG MSGTYPE(*LAST) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) CHGVAR VAR(&SEQ) VALUE(&SEQ + 1) GOTO CMDLBL(RPT) QUIT: CHKTAP DEV(&DEV) SEQNBR(*NONE) ENDOPT(*REWIND) GOTO CMDLBL(ENDCLPGM) /**********************************************************************/ /* Global Error Handler /**********************************************************************/ ERROR: RCVMSG MSGTYPE(*LAST) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) DMPCLPGM DSPJOBLOG OUTPUT(*PRINT) IF COND(&INTER *EQ '1') THEN( + SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA)) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE) ENDCLPGM: ENDPGM Cheers Rob -----Original Message----- From: midrange-l-admin@midrange.com [mailto:midrange-l-admin@midrange.com] On Behalf Of steven.donnellan@simonjersey.com Sent: 17 October 2002 15:19 To: midrange-l@midrange.com Subject: Restore question.. This is a multipart message in MIME format. -- [ Picked text/plain from multipart/alternative ] I know I can save a batch of related libraries by SAVLIB LIB(SJL*)... Is there an equivlent way of doing a batch RSTLIB instead of having to restore each library seperately? Steven Donnellan AS/400 Systems Manager IBM Certified Specialist - AS/400 Professional Operator Simon Jersey Ltd http://www.simonjersey.com ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately and notify the sender, do not discuss or disclose the contents. The views expressed in the e-mail are those of the author and not necessarily those of Simon Jersey Limited. ********************************************************************** -- _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l or email: MIDRANGE-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.