Results 1 to 2 of 2

Thread: RGZPFPCT - RGZPFM by percentage deleted records

  1. #1
    Join Date
    Dec 2006
    Location
    Trebgast, Germany
    Posts
    1,477

    Default RGZPFPCT - RGZPFM by percentage deleted records

    This command will perform a RGZPFM for each file (table) found matching the input criteria. The input parameters are soft, i.e. generic (nam*) names can be used and the libraray selection has also been expanded. Allows for a percentage deleted records threshold to be input (new feature).

    Important:
    1. Member locks are catered for (new feature).
    2. The current library/file/member being re-orged is displayed (new feature).
    3. No footprint is retained after execution.
    4. May be executed in batch or interactively.
    5. After restoring on your box, use CHGCMD CMD(RGZPFPCT) PGM(xxxxx/RGZPFPCTC) where xxxx = the library to which you restored.

    Objects created to v510. Tested from v530 thru v540.

    Contents of ZIP file is a savf containing the CMD, CLLE, and RPGLE. Hope you will find it useful.

    Command
    Code:
        /* ---------------------------------------------------------------------*/ 
        /*  System Name .....: ECOTOOLS                                         */ 
        /*  Company..........: Ecofit Ltd                                       */ 
        /*  Author...........: Deon A von Blerk                                 */ 
        /*  Date.............: 16.05.08                                         */ 
        /*  Description......: RGZPFM by percentage deleted records             */ 
        /*                                                                      */ 
        /*  MODIFICATION CONTROL                                                */ 
        /*  ====================                                                */ 
        /*    Date    Nr  By/Reason                                             */ 
        /*    ====    ==  =========                                             */ 
        /* ---------------------------------------------------------------------*/ 
                CMD        PROMPT('RGZPFM by Percentage Deleted')                  
     
                PARM       KWD(FILE) TYPE(QUAL1) MIN(1) PROMPT('File')             
                PARM       KWD(PCT) TYPE(*DEC) LEN(3) DFT(10) RANGE(1 +            
                             100) PROMPT('Percentage deleted records')             
     
                QUAL1:    QUAL       TYPE(*GENERIC) LEN(10) DFT(*ALL) SPCVAL((*ALL))
                          QUAL       TYPE(*NAME) LEN(10) DFT(*ALLUSR) +        
                             SPCVAL((*LIBL) (*USRLIBL) (*CURLIB) +   
                             (*ALL) (*ALLUSR)) PROMPT('Library')
    CLLE
    Code:
    /* ---------------------------------------------------------------------*/
    /*  System Name .....: ECOTOOLS                                         */
    /*  Company..........: Ecofit Ltd                                       */
    /*  Author...........: Deon A von Blerk                                 */
    /*  Date.............: 06.10.04                                         */
    /*  Description......: RGZPFM by percentage deleted records             */
    /*                                                                      */
    /*  MODIFICATION CONTROL                                                */
    /*  ====================                                                */
    /*    Date    Nr  By/Reason                                             */
    /*    ====    ==  =========                                             */
    /* ---------------------------------------------------------------------*/
            PGM        PARM(&FILELIB &PCT)                                    
     
            DCL        VAR(&FILELIB) TYPE(*CHAR) LEN(20)                      
            DCL        VAR(&FILE) TYPE(*CHAR) LEN(10)                         
            DCL        VAR(&LIB) TYPE(*CHAR) LEN(10)                          
            DCL        VAR(&PCT) TYPE(*DEC) LEN(3 0)                          
     
                 CHGVAR     VAR(&FILE) VALUE(%sst(&filelib 1 10))                  
                 CHGVAR     VAR(&LIB) VALUE(%sst(&filelib 11 10))                  
     
    /* Build the data                                                   */         
                 DSPFD      FILE(&LIB/&FILE) TYPE(*MBR) OUTPUT(*OUTFILE) +         
                              FILEATR(*PF) OUTFILE(QTEMP/RGZPFPCTP)                
                 MONMSG     MSGID(CPF0000) EXEC(DO)                                
                    SNDPGMMSG  MSG('Could not find any files to re-org. Please +   
                                 check your input.')                               
                    GOTO       CMDLBL(EOJ)                                         
                 ENDDO                                                             
     
    /* Reorg the files                                                */           
                 CALL       PGM(RGZPFPCTR) PARM(&PCT)                              
                 MONMSG     MSGID(CPF0000) EXEC(DO)                                
                    SNDPGMMSG  MSG('Unknown error. Please check something.')       
                    GOTO       CMDLBL(EOJ)                                         
                 ENDDO                                                             
     
    SUCCESS:                                                                      
    EOJ:        ENDPGM
    RPGLE as .txt attachment
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by kitvb1; 30th May 2008 at 08:48. Reason: Added point 5.
    Regards

    Kit

  2. #2
    Join Date
    Dec 2006
    Location
    Trebgast, Germany
    Posts
    1,477

    Default

    Updated this command to cater for 0-100% deleted records.
    Reason: RGZPFM may need to be run over a file containing only a few deleted records to correct an access path.

    Please change appropriate line in the CMD source as follows:
    Code:
                PARM       KWD(PCT) TYPE(*DEC) LEN(3) DFT(10) RANGE(0 +
    Regards

    Kit

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •