|
On Wednesday, May 13, 1998 6:34 AM, Vernon Hamberg [SMTP:hambergv@goldengate.net] wrote: > Chuck > > At 07:32 PM 5/13/1998 -0400, you wrote: > >Thanks Neil, > > > >I may try to write somethig on my own. I have written programs to monitor an outq > >and delete spool files 30+ days old on a nightly basis (I don't use the system > >cleanup to do this because we have other outqs that need have spool files that > >need to be kept for several months before removal..). This is a pgm I use to do this very thing. I don't claim to have written this code, only modified it to work in my environment. The code maybe part of TAATOOL as it was on the machine already. KatK 0100 INIT: PGM 0200 0300 DCL VAR(&DATE1) TYPE(*CHAR) LEN(6) 0400 DCL VAR(&DATE2) TYPE(*CHAR) LEN(5) 0500 DCL VAR(&DATE3) TYPE(*DEC) LEN(6 0) 0600 DCL VAR(&DATE4) TYPE(*CHAR) LEN(6) 0700 DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(132) 0800 DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) 0900 DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) 1000 DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) 1100 DCL VAR(&COUNT) TYPE(*DEC) LEN(6 0) VALUE(1) 1200 DCL VAR(&COUNTC) TYPE(*CHAR) LEN(6) 1300 1400 /* CVTWRKSPLF output file */ 1500 DCLF FILE(KATK/WRKSPLFP) RCDFMT(SFREC) 1600 1700 /* Error trapping */ 1800 MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR)) 1900 2000 /* Get the current files */ 2100 CVTWRKSPLF USER(*ALL) OUTLIB(KATK) 2200 MONMSG MSGID(CPF3344) EXEC(GOTO CMDLBL(ERROR)) 2300 2400 /* Determine date 35 days prior */ Note: can be any # of days 2500 2600 RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DATE1) 2700 CVTDAT DATE(&DATE1) TOVAR(&DATE2) FROMFMT(*MDY) + 2800 TOFMT(*JUL) TOSEP(*NONE) 2900 CHGVAR VAR(&DATE3) VALUE(&DATE2) 3000 CHGVAR VAR(&DATE3) VALUE(&DATE3 - 35) Here's where you charge the days 3100 CHGVAR VAR(&DATE2) VALUE(&DATE3) 3200 CVTDAT DATE(&DATE2) TOVAR(&DATE4) FROMFMT(*JUL) + 3300 TOFMT(*YMD) TOSEP(*NONE) 3400 3500 /* Read the next record from the file */ 3600 READ: RCVF 3700 MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)) 3800 3900 /* Skip protected records */ This is where you exclude outq's not to be cleared 4000 4100 IF COND(&SFOUTQ = 'QEZJOBLOG') THEN(GOTO CMDLBL(READ)) ! 4200 IF COND(&SFOUTQ = 'PHIL') THEN(GOTO CMDLBL(READ)) ! 4300 IF COND(&SFOUTQ = 'KATKP1') THEN(GOTO CMDLBL(READ)) ! Exclude select outq's here 4400 IF COND(&SFOUTQ = 'PHILS2') THEN(GOTO CMDLBL(READ)) ! 4500 IF COND(&SFOUTQ = 'PRT02') THEN(GOTO CMDLBL(READ)) ! 4600 IF COND(&SFOUTQ = 'PRT04') THEN(GOTO CMDLBL(READ)) ! 4700 IF COND(&SFOUTQ = 'PRT13') THEN(GOTO CMDLBL(READ)) ! 4800 4900 IF COND(&SFOUTL = 'KATK') THEN(GOTO CMDLBL(READ)) ! 5000 IF COND(&SFOUTL = 'LORRAINE') THEN(GOTO CMDLBL(READ)) ! Exclude all outq's in a selected 5100 IF COND(&SFOUTL = 'LVLIB') THEN(GOTO CMDLBL(READ)) ! library here. 5200 5300 /* Delete non-protected files 35 days or older */ 5400 5500 IF COND(&SFCEN = '0') THEN(IF COND(&SFDAT <= &DATE4) THEN(DO)) 5600 5700 5800 DLTSPLF FILE(&SFFILE) JOB(&SFJNBR/&SFUSER/&SFJNAM) + 5900 SPLNBR(&SFFNBR) 6000 6100 CHGVAR VAR(&COUNT) VALUE(&COUNT + 1) 6200 6300 GOTO CMDLBL(READ) 6400 6500 ENDDO 6600 6700 GOTO CMDLBL(READ) 6800 6900 /* Error trapping */ 7000 7100 ERROR: RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) + 7200 MSGF(&MSGF) MSGFLIB(&MSGFLIB) 7300 SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + 7400 MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE) 7500 7600 END: CHGVAR VAR(&COUNTC) VALUE(&COUNT) 7700 SNDMSG MSG(&COUNTC *BCAT 'reports cleared.') + 7800 TOUSR(*REQUESTER) 7900 8000 ENDPGM +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@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-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.