Information Systems:OUTQCLEAR
Revision as of 17:16, 4 February 2016 by Sheilav (talk | contribs) (Created page with "→Write list of spool files in out queues PRT01 and QPRINT to spool: →files, then copy those spool files to a data file.: WRKOUTQ...")
/* Write list of spool files in out queues PRT01 and QPRINT to spool */
/* files, then copy those spool files to a data file. */
WRKOUTQ OUTQ(PRT01) OUTPUT(*PRINT)
CPYSPLF FILE(QPRTSPLQ) TOFILE(REPORT) SPLNBR(*LAST) +
TOMBR(OUTQ)
WRKOUTQ OUTQ(QPRINT) OUTPUT(*PRINT)
CPYSPLF FILE(QPRTSPLQ) TOFILE(REPORT) SPLNBR(*LAST) +
TOMBR(OUTQ) MBROPT(*ADD)
/* Run a query to build a file of all spool files that can be deleted. */
/* This query has a list of reports that are never printed. */
RUNQRY QRY(OUTQCLR) QRYFILE((*LIBL/REPORT))
/* Read through the created file, and delete those spool files in it. */
NEXT:
RCVF RCDFMT(OUTQDEL)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
CHGVAR VAR(&NUMBER) VALUE(&FILENUMB)
DLTSPLF FILE(&FILE) JOB(&JOBNUMB/&USER/&JOB) +
SPLNBR(&NUMBER)
GOTO CMDLBL(NEXT)
END:
/* Delete the two spool files that were created. */
DLTSPLF FILE(QPRTSPLQ) SPLNBR(*LAST)
DLTSPLF FILE(QPRTSPLQ) SPLNBR(*LAST)