Problem solve Get help with specific problems with your technologies, process and projects.

Dynamically reorganizing DB2 files -- Take 2

An update to Mr. Codispoti's tip. I've combined his 3 programs into one -- similar to the program that we use.

Just an update to Peter Codispoti's fine tip. I've just combined his three programs into one -- similar to a program that we use.

I'm sure if we had the time, we could all look back at the multitude of utilities that we've written and update the heck out of them -- especially with the improvements/enhancements that IBM has made to OS/400 over the years. It's just amazing to me that we have programs and objects from the early 1980's that are still in use on our system today. Thanks IBM!

           /******************************************************************/
           /*  PROGRAM: REORG                                                */
           /*  PURPOSE: CREATE A LIST OF FILES/MEMBERS.  THEN CALL SYGMBR2   */
           /*           WHICH WILL LOOK FOR DELETED RECORDS.  IF DELETED     */
           /*           RECORDS EXIST FILE MEMBER WILL BE REORGANIZED.       */
           /*           FILE NAME: QGPL/SYPMBR CREATED BY DSPFD CMD          */
           /*                                                                */
           /*   NOTE -- THIS PROGRAM MUST BE COMPILED WITH OBJECT AUTH.      */
           /*           OF *OWNER.                                           */
           /*                                                                */
           /*       BY: PETE CODISPOTI   9/16/97                             */
           /*                                                                */
           /******************************************************************/
             PGM
             DCL        VAR(&JOBQ) TYPE(*CHAR) LEN(10)
             DCLF       FILE(QGPL/SYPMBR)
             MONMSG     MSGID(CPF9999)

 BEGIN:      DSPFD      FILE(AM2000/*ALL) TYPE(*MBRLIST) +
                          OUTPUT(*OUTFILE) FILEATR(*PF) +
                          OUTFILE(QGPL/SYPMBR)
                    .
                    .
                    .

 LOOP:       RCVF
             MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDALL))

             IF         COND(&MLNDTR *EQ 0) THEN(GOTO CMDLBL(LOOP))

             IF         COND(%SST(&MLFILE 1 2) *EQ 'AM') THEN(CHGVAR +
                          VAR(&JOBQ) VALUE('QBATCH'))
                    .
                    .
                    .

             SBMJOB     CMD(RGZPFM FILE(&MLLIB/&MLFILE) MBR(&MLMBR)) +
                          JOB(&MLFILE) JOBD(MNHJOBD) JOBQ(&JOBQ)
             MONMSG     MSGID(CPF0000)

             GOTO       CMDLBL(LOOP)

 ENDALL:     ENDPGM 

Dig Deeper on Integrated File System (IFS)

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close