× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This is the program we set up with the associated PF.  It reads the list of
queues to clean and the number of days to keep from the PF.  Hope this
helps.

Program:

             PGM        PARM(&OUTQ &LIB &DAYSCH)

             DCLF       FILE(KOGTMP/CLNOUTQTMP)

             DCL        VAR(&FQUEUE) TYPE(*DEC) LEN(3) VALUE(1)
             DCL        VAR(&FLIB) TYPE(*DEC) LEN(3) VALUE(11)
             DCL        VAR(&OUTQ) TYPE(*CHAR) LEN(10)
             DCL        VAR(&LIB) TYPE(*CHAR) LEN(10)
             DCL        VAR(&DAYSCH) TYPE(*CHAR) LEN(3)
             DCL        VAR(&DAYS) TYPE(*DEC) LEN(3)
             DCL        VAR(&FDAYS) TYPE(*DEC) LEN(3) VALUE(21)
             DCL        VAR(&SPLF) TYPE(*CHAR) LEN(10) VALUE('QPRTSPLQ')
             DCL        VAR(&DATCALC) TYPE(*CHAR) LEN(8)
             DCL        VAR(&DATDEC) TYPE(*DEC) LEN(8)
             DCL        VAR(&SYSDEC) TYPE(*DEC) LEN(8)
             DCL        VAR(&SYSDAT) TYPE(*CHAR) LEN(6)
             DCL        VAR(&SYSCALC) TYPE(*CHAR) LEN(8)

        /* STARTING VARIABLES OF SPOOL FILE */
            DCL        VAR(&FILE) TYPE(*CHAR) LEN(10)
            DCL        VAR(&USER) TYPE(*CHAR) LEN(10)
            DCL        VAR(&FILENUM) TYPE(*CHAR) LEN(3)
            DCL        VAR(&SPLNUM) TYPE(*DEC) LEN(3)
            DCL        VAR(&JOBNUM) TYPE(*CHAR) LEN(10)
            DCL        VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
            DCL        VAR(&DATE) TYPE(*CHAR) LEN(10)

            RTVJOBA    DATE(&SYSDAT)

            IF         COND(&OUTQ *NE ' ') THEN(DO)

            CHGVAR     VAR(&DAYS) VALUE(&DAYSCH)

            WRKOUTQ    OUTQ(&LIB/&OUTQ) OUTPUT(*PRINT)
            CPYSPLF    FILE(&SPLF) TOFILE(KOGTMP/CLNOUTQTMP) +
                         SPLNBR(*LAST)
            DLTSPLF    FILE(&SPLF) SPLNBR(*LAST)

NEXT:       RCVF
            MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

            CHGVAR     VAR(&FILE) VALUE(%SUBSTRING(&CLNOUTQTMP 2 10))
            CHGVAR     VAR(&USER) VALUE(%SUBSTRING(&CLNOUTQTMP 13 10))
            CHGVAR     VAR(&FILENUM) VALUE(%SUBSTRING(&CLNOUTQTMP 74 3))
            CHGVAR     VAR(&JOBNUM) VALUE(%SUBSTRING(&CLNOUTQTMP 93 6))
            CHGVAR     VAR(&JOBNAME) VALUE(%SUBSTRING(&CLNOUTQTMP 82 10))
            CHGVAR     VAR(&DATE) VALUE(%SUBSTRING(&CLNOUTQTMP 100 8))

            IF         COND(&FILE *NE '        * ') THEN(DO)
            IF         COND(&FILE *NE 'File      ') THEN(DO)
            IF         COND(&FILE *NE '5769SS1  V') THEN(DO)
            IF         COND(&FILE *NE '          ') THEN(DO)

            CHGVAR     VAR(&SPLNUM) VALUE(&FILENUM)

            CVTDAT     DATE(&DATE) TOVAR(&DATCALC) FROMFMT(*MDY) +
                         TOFMT(*YYMD) TOSEP(*NONE)
            CHGVAR     VAR(&DATDEC) VALUE(&DATCALC)
            CHGVAR     VAR(&DATDEC) VALUE(&DATDEC + &DAYS)
            CVTDAT     DATE(&SYSDAT) TOVAR(&SYSCALC) FROMFMT(*MDY) +
                         TOFMT(*YYMD) TOSEP(*NONE)
            CHGVAR     VAR(&SYSDEC) VALUE(&SYSCALC)

            IF         COND(&SYSDEC > &DATDEC) THEN(DO)
            DLTSPLF    FILE(&FILE) JOB(&JOBNUM/&USER/&JOBNAME) +
                         SPLNBR(&SPLNUM)
            ENDDO

            ENDDO
            ENDDO
            ENDDO
            ENDDO
            GOTO       CMDLBL(NEXT)


END:        ENDDO

            CLRPFM     FILE(KOGTMP/CLNOUTQTMP)

             ENDPGM

File:

      R CLNOUTQ
        OUTQ          10A
        LIB           10A
        DAYS           3A

Eric Graeb
AS/400 Administrator
King Optical Group Inc.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.