kitvb1
17th May 2008, 22:31
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
/* ---------------------------------------------------------------------*/
/* 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
/* ---------------------------------------------------------------------*/
/* 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
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
/* ---------------------------------------------------------------------*/
/* 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
/* ---------------------------------------------------------------------*/
/* 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