RESTAURATION-AS400

Jean-Pierre Laroche


Laroche.jeanpierre@gmail.com



Ne pas oublier,

a) de débrancher les cables IP et Twinax pour ne pas avoir de DEVD en Création automatique

    avant même que l'inspecteur initialis le microcode.

b) une fois la restauration faite vous pouvez re brancher




PGM                                                                          

                                                                             

             CHGJOB     LOG(4 00 *MSG) OUTQ(QPRINT)                                      

                                                                             

             ENDSBS     SBS(*ALL) OPTION(*IMMED) +                           

                          ENDSBSOPT(*NOJOBLOG) BCHTIMLMT(*NOMAX)             

                                                                             

                                                                             

/* REST *ALL LIB    *IBM & *ALLUSER     */                                   

             RSTLIB    SAVLIB(*NONSYS) DEV(TAP01) ENDOPT(*LEAVE)             

                                                                             

                                                                             

/* REST *ALL DLO                        */                                   

             RSTDLO     *ALL  DEV(TAP01) ENDOPT(*LEAVE)                      

                                                                             

/* REST *ALL OBJETS SPECIAUX            */                                   

             RST        DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('/*') )             

                                                                             

/* REST *ALL CONFIG(*DEVD ....)         */                                   

             RSTCFG     OBJ(*ALL) DEV(TAP01) ENDOPT(*LEAVE)  ALWOBJDIF(*ALL) 

                                                                             

                                                                             

/* REST *ALL CONFIG(*USRPRF...)         */

             RSTUSRPRF  DEV(TAP01) ENDOPT(*LEAVE) ALWOBJDIF(*ALL)      

                                                                      

/* VALIDE LES AUTORISATIONS...          */                            

             RSTAUT     USRPRF(*ALL)                                  

                                                                      

/* EJECTE LA BANDE                      */                            

             CHKTAP     DEV(TAP01) ENDOPT(*UNLOAD)                    

                                                                      

/* TRACE DU JOB                         */                            

             DSPJOBLOG  OUTPUT(*PRINT)                                

                                                                      

                                                                      

    ENDPGM


des petits programmes pour vous aider à restaurer vos lib... journalière


PRST_01LST   /* liste des objets sur bande  supprimmer les enregistrements à ne pas restaurer*/

PGM

             DSPTAP     DEV(TAP01) OUTPUT(*PRINT)

             DSPTAP     DEV(TAP01) OUTPUT(*OUTFILE) +

                          OUTFILE(CONFIG/FRSTALL)

DSPPFM CONFIG/FRSTALL /* on jete un coup d'oeil */

UPDDTA CONFIG/FRSTALL

FIN: ENDPGM



PRST_02DLT   /* suppression du journal */

     PGM PARM(&LIB)

     DCL VAR(&REP) TYPE(*CHAR) LEN(1)

     DCL VAR(&LIB) TYPE(*CHAR) LEN(10)

     DCL VAR(&SOC) TYPE(*CHAR) LEN(10)


     MONMSG MSGID(CPF2105)

     MONMSG MSGID(CPF9801)

     ENDJRNPF FILE(*ALL) JRN(&LIB/JRNFCH)

DLT: +

     DLTJRN JRN(&LIB/JRNFCH)

     MONMSG MSGID(CPF9803) CMPDTA(EXEC) EXEC(DO)

     SNDUSRMSG MSG('veuillez arrêté la société --> ' *CAT &SOC *CAT '-

réponse O/N') VALUES(O N) TOMSGQ(QSYSOPR) MSGRPY(&REP)

     GOTO CMDLBL(DLT)

     ENDDO

     MONMSG MSGID(CPF7021) CMPDTA(EXEC) EXEC(DO)

     SNDUSRMSG MSG('veuillez arrêté la société --> ' *CAT &SOC *CAT '-

réponse O/N') VALUES(O N) TOMSGQ(QSYSOPR) MSGRPY(&REP)

     GOTO CMDLBL(DLT)

     ENDDO

     CHGJOB INQMSGRPY(*SYSRPYL)

     DLTJRNRCV JRNRCV(&LIB/RCV*)

     CHGJOB INQMSGRPY(*RQD)

     CRTJRNRCV JRNRCV(&LIB/RCV0000001) THRESHOLD(1919999)

     CRTJRN JRN(&LIB/JRNFCH) JRNRCV(&LIB/RCV0000001)

     GRTOBJAUT OBJ(CONFIG/JRNFCH) OBJTYPE(*ALL) USER(QPGMR) AUT(*ALL)

     MONMSG MSGID(CPF0000)

     ENDPGM



PRST_03CLR  /* clear des lib. 1 passage *logique ect... */

PGM

             DCL        VAR(&LIB) TYPE(*CHAR) LEN(10)

             DCL        VAR(&SEQ) TYPE(*DEC) LEN(4 0)

             DCLF       FILE(CONFIG/FRSTALL)


RE:          RCVF  RCDFMT(QTADOUTF)

             MONMSG CPF0864 EXEC(GOTO FIN)

             CHGVAR     VAR(&LIB) VALUE(%SST(&RDTRL1 5 10))

             CHGVAR     VAR(&SEQ) VALUE(&RDLFSQ)

             CLRLIB &LIB

MONMSG CPF0000

             IF (&SEQ *EQ 81 ) GOTO FIN   /* SEQ =82  QDOC  les documents  */

             GOTO RE

FIN: ENDPGM


PRST_04LCR   /* 2° passage Phy ect.... */

PGM

             DCL        VAR(&LIB) TYPE(*CHAR) LEN(10)

             DCL        VAR(&SEQ) TYPE(*DEC) LEN(4 0)

             DCLF       FILE(CONFIG/FRSTALL)


RE:          RCVF  RCDFMT(QTADOUTF)

             MONMSG CPF0864 EXEC(GOTO FIN)

             CHGVAR     VAR(&LIB) VALUE(%SST(&RDTRL1 5 10))

             CHGVAR     VAR(&SEQ) VALUE(&RDLFSQ)

             CLRLIB &LIB

MONMSG CPF0000

             IF (&SEQ *EQ 81 ) GOTO FIN   /* SEQ =82 QDOC */

             GOTO RE

FIN: ENDPGM


PRST_05LIB   /* restauration des lib. */

PGM

             DCL        VAR(&LIB) TYPE(*CHAR) LEN(10)

             DCL        VAR(&SEQ) TYPE(*DEC) LEN(4 0)

             DCLF       FILE(CONFIG/FRSTALL)


RE:          RCVF  RCDFMT(QTADOUTF)

             MONMSG CPF0864 EXEC(GOTO FIN)

             CHGVAR     VAR(&LIB) VALUE(%SST(&RDTRL1 5 10))

             CHGVAR     VAR(&SEQ) VALUE(&RDLFSQ)

             RSTLIB     SAVLIB(&LIB) DEV(TAP01) SEQNBR(&SEQ) +

                          ENDOPT(*LEAVE)

MONMSG CPF0000

             IF (&SEQ *EQ 81 ) GOTO FIN     /* SEQ =82 QDOC */

             GOTO RE

FIN: ENDPGM


PRST06_JRN /* petit programme qui lit un fichier contenant la lib et le physique a journaliser */

PGM


DCLF FILE(LBIB01C) RCDFMT(BIB01FC)


CALL RUSP00  /* CREATION USER SPACE QTEMP/USRSP99 */


/* CALL PJRNRCV ('CONFIG') */


LEC: RCVF

     MONMSG CPF0864 EXEC(GOTO FIN)

     CALL RJRNFCH (&BILIB '1')                 

     GOTO LEC


FIN: ENDPGM


PRST_07DLO  /* exemple de programme pour restauration dlo */

PGM

/*VEUILLEZ RENOMER LES DOSSIERS  AVANT */

             RNMDLO     DLO(ALUR)    NEWDLO(XALUR      )

             RNMDLO     DLO(AUTOSUR) NEWDLO(XAUTOSUR   )

             RNMDLO     DLO(DELPHI)  NEWDLO(XDELPHI    )

RSTDLO DLO(*ALL) SAVFLR(ALUR       +

                       AUTOSUR      +

                       DELPHI      ) +

                   DEV(TAP01) ENDOPT(*LEAVE)    SEQNBR(82)   +

  LABEL(QDOC) NEWOBJ(*NEW)


/*VEUILLEZ DELETE  LES DOSSIERS  APRES si OK*/

ENDPGM


PRST_08IFS  /* programme resintallation IFS USER pour exemple  */

PGM

/*VEUILLEZ RENOMER LES OBJET DANS LA ROOT AVANT */

/*VEUILLEZ CONTROLER AVEC UPDDTA CONFIG/FRSTALL  LA VALIDITE DE SEQNBR */

RNM        OBJ('REPXLS') NEWOBJ(XREPXLS)


RST DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('REPXLS'))         SEQNBR(83) +

                                 LABEL(REPXLS)          ENDOPT(*LEAVE)


/* SI OK DELETE DES OBJET RENOMER */

ENDPGM


PRST_09IMG  /* resauration de notre imagecatalogue bande et cd virtuel */

PGM

/* LIB IMAGE COMPTA AVANT ANOUVEAU */

RST DEV('/QSYS.LIB/TAP01.DEVD') OBJ(('IMGCATALOG'))     SEQNBR(89) +

                                LABEL(IMGCATALOG)      ENDOPT(*LEAVE)

ENDPGM

Copyright © <2009>, <Laroche Jean-Pierre>

Created with the Freeware Edition of HelpNDoc: Easily create HTML Help documents