|
The following programs will clear empty members from files. It will bypass a member if it matches the name of the file. We have always run the programs when we have a dedicated system and know we have exclusive access to the file. You may want to add an ALCOBJ command to be cautious. ------------------------------------------------------------------------- CL Program #1 Selects members with no records for deletion ------------------------------------------------------------------------- PGM PARM(&FIL &LIB) DCL VAR(&FIL) TYPE(*CHAR) LEN(10) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCLF FILE(QAFDMBRL) DSPFD FILE(&LIB/&FIL) TYPE(*MBRLIST) + OUTPUT(*OUTFILE) OUTFILE(QTEMP/FTMBRLIST) OVRDBF FILE(QAFDMBRL) TOFILE(QTEMP/FTMBRLIST) /* CREATE A LIST OF ALL LOGICAL FILES */ OVRDBF FILE(QADSPDBR) TOFILE(QTEMP/DBR) DSPDBR FILE(&LIB/&FIL) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/DBR) /* READ THRU MEMBER LISTING - A MEMBER IS ELIGABLE TO DELETE IF: */ /* IT HAS NO ACTIVE RECORDS */ /* THE MEMBER NAME IS NOT THE FILE NAME */ TAG02: RCVF RCDFMT(QWHFDML) WAIT(*YES) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)) IF (&MLNRCD *NE 0) THEN(GOTO TAG02) IF (&MLNAME *EQ &MLFILE) THEN(GOTO TAG02) CALL DLTMBR PARM(&MLNAME &FIL &LIB) GOTO CMDLBL(TAG02) END: ENDPGM ------------------------------------------------------------------------- CL Program #2 Deletes logical file members ------------------------------------------------------------------------- PGM PARM(&MBR &FIL &LIB) DCL VAR(&MBR) TYPE(*CHAR) LEN(10) DCL VAR(&FIL) TYPE(*CHAR) LEN(10) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80) DCL VAR(&NOGO) TYPE(*CHAR) LEN(1) VALUE('Y') DCLF FILE(QADSPDBR) OVRDBF FILE(QADSPDBR) TOFILE(QTEMP/DBR) /* DSPDBR FILE(&LIB/&FIL) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/DBR) */ TAG01: RCVF RCDFMT(QWHDRDBR) WAIT(*YES) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(TAG02)) /* If + end of file go to END. */ IF (&WHREFI *EQ ' ') THEN(GOTO TAG02) CHKOBJ OBJ(&WHRELI/&WHREFI) OBJTYPE(*FILE) MBR(&MBR) MONMSG MSGID(CPF9815) EXEC(GOTO CMDLBL(TAG01)) RMVM FILE(&WHRELI/&WHREFI) MBR(&MBR) MONMSG MSGID(CPF0000) EXEC(DO) CHGVAR VAR(&MSGDTA) VALUE('LOGICAL FILE MEMBER NOT + REMOVED') SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + TOPGMQ(*EXT) MSGTYPE(*NOTIFY) CHGVAR VAR(&NOGO) VALUE('N') ENDDO GOTO TAG01 TAG02: IF COND(&NOGO *EQ 'Y') THEN(DO) RMVM FILE(&LIB/&FIL) MBR(&MBR) MONMSG MSGID(CPF0000) EXEC(DO) CHGVAR VAR(&MSGDTA) VALUE('PHYSICAL FILE MEMBER + NOT REMOVED') SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + TOPGMQ(*EXT) MSGTYPE(*NOTIFY) ENDDO ENDDO ENDPGM -----Original Message----- From: owner-bpcs-l@midrange.com On Behalf Of MrLennyB@aol.com Sent: Thursday, September 10, 1998 9:39 AM To: BPCS-L@midrange.com Subject: Files with Empty members With BPCS V4.0.4, several files, such as ECH, ECL, FSO, FOD, FMA , etc. have empty members. Does anyone know of an orderly way to delete these empty members. I have looked through the System Reorg programs and it doesn't appear that BPCS has a program to satisfy this function. Any help would be appreciated. Thanks Lenny Bellott Shop-Vac Corp. +--- | This is the BPCS Users Mailing List! | To submit a new message, send your mail to BPCS-L@midrange.com. | To subscribe to this list send email to BPCS-L-SUB@midrange.com. | To unsubscribe from this list send email to BPCS-L-UNSUB@midrange.com. | Questions should be directed to the list owner: dasmussen@aol.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.