|
Here's my own version. I wrote this myself and it works. You'll need to tweak it for your own use (I hard coded JIMCONEX for the output of the file, would of been better to use QTEMP on retrospect). Also note that I will attempt to lock the file exclusively before trying to reorganize it. If it can't lock the file it will skip it and go on to the next one. PGM PARM(&LIBNAME &THRESH) DCLF FILE(JIMCONEX/DSPFD) DCL VAR(&LIBNAME) TYPE(*CHAR) LEN(10) DCL VAR(&THRESH) TYPE(*CHAR) LEN(10) DCL VAR(&THRESHOLD) TYPE(*DEC) LEN(10 0) DCL VAR(&PCNDLT) TYPE(*DEC) LEN(12 2) DCL VAR(&PCNDLTCH) TYPE(*CHAR) LEN(12) CHGVAR VAR(&THRESHOLD) VALUE(&THRESH) DSPFD FILE(&LIBNAME/*ALL) TYPE(*MBRLIST) + OUTPUT(*OUTFILE) FILEATR(*PF) + OUTFILE(JIMCONEX/DSPFD) READREC: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF)) IF COND((&MLNDTR + &MLNRCD) *EQ 0) THEN(CHGVAR + VAR(&PCNDLT) VALUE(0)) ELSE CMD(CHGVAR VAR(&PCNDLT) VALUE(&MLNDTR / + (&MLNRCD + &MLNDTR) * 100)) IF COND(&PCNDLT *GE &THRESHOLD) THEN(DO) ALCOBJ OBJ((&MLLIB/&MLFILE *FILE *EXCL &MLNAME)) + WAIT(0) MONMSG MSGID(CPF1002) EXEC(DO) SNDMSG MSG(&MLLIB *CAT '/' *CAT &MLFILE *CAT ':' + *CAT &MLNAME *BCAT 'IN USE - NOT + REORGANIZED') TOUSR(*REQUESTER) GOTO CMDLBL(READREC) ENDDO RGZPFM FILE(&MLLIB/&MLFILE) MBR(&MLNAME) DLCOBJ OBJ((&MLLIB/&MLFILE *FILE *EXCL &MLNAME)) 0040.00 CHGVAR VAR(&PCNDLTCH) VALUE(&PCNDLT) SNDMSG MSG(&MLLIB *CAT '/' *CAT &MLFILE *CAT ':' + *BCAT &MLNAME *BCAT 'PCT:' *BCAT + &PCNDLTCH *BCAT 'REORGANIZED') + TOUSR(*REQUESTER) ENDDO GOTO CMDLBL(READREC) EOF: ENDPGM Regards, Jim Langston Date: Thu, 28 Dec 2000 09:51:59 -0500 From: "Shaw, David" <dshaw@spartan.com> Subject: Anyone have RGZPF? Yo! Years ago News/400 published a utility called RGZPF which was handy for reorganizing files in a library. I used it at my previous employer, and I imagine they're still using it. I didn't think to make a copy of it to bring here, assuming I'd be able to get it from the CD or web site. Unfortunately, it was published too far back to be available on either! Does anyone have a copy of it that they'd be willing to e-mail to me? I could re-write it from memory, but I'd rather save the debugging time if possible. Thanks! Dave Shaw Spartan International, Inc. Spartanburg, SC To subscribe to the MAPICS-L mailing list send email to MAPICS-L-SUB@midrange.com or go to www.midrange.com and follow the instructions. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.