If you submit jobs to batch with any frequency, you've had to manage "completion message clutter" (i.e., JOB XXX COMPLETED NORMALLY). Completion messages may obscure other messages that you want to keep (I use my message queue as an informal to-do list, as well as to store bits of info sent by other users), and can be time-consuming to eradicate one at a time.
Command RMVJOBMSG (5a) and its processing program JOB002CL (5b) zap job completion messages, while leaving all other messages intact in your message queue. To run the command, you must be using the terminal you first signed on to, or the command will fail with an error message "unable to allocate message queue." Provide your message queue name (usually the same as your user sign-on), and the library name that the message queue lives in (as written, the library name defaults to QUSRSYS).
Command RMVJOBMSG (Figure 5a) and its processing program JOB002CL (Figure 5b) zap job completion messages, while leaving all other messages intact in your message queue. To run the command, you must be using the terminal you first signed on to, or the command will fail with an error message "unable to allocate message queue." Provide your message queue name (usually the same as your user sign-on), and the library name that the message queue lives in (as written, the library name defaults to QUSRSYS).
If you're worried about needing the completion messages seconds after completing the command, you could include a DSPMSG OUTPUT(*PRINT) to keep a hard copy.
TechTalk: Removing Job Completion Messages
Figure 5A Command RMVJOBMSG
RMVJOBMSG: CMD PROMPT('Remove Job Completion Messages') PARM KWD(MSGQ) TYPE(Q1) PROMPT('Message queue') Q1: QUAL TYPE(*SNAME) LEN(10) DFT(*USRPRF) + SPCVAL((*USRPRF) (*WRKSTN) (*SYSOPR)) QUAL TYPE(*SNAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL)) PROMPT('Library')
TechTalk: Removing Job Completion Messages
Figure 5B CL program JOB002CL
JOB002CL: + PGM PARM(&QUALMSGQ) DCL VAR(&QUALMSGQ) TYPE(*CHAR) LEN(20) DCL VAR(&MSGQ) TYPE(*CHAR) LEN(10) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) VALUE(CPF1241) MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(DLCOBJ)) /* Break qualified name */ CHGVAR VAR(&MSGQ) VALUE(%SST(&QUALMSGQ 1 10)) CHGVAR VAR(&LIB) VALUE(%SST(&QUALMSGQ 11 10)) /* Translate special values into actual names */ IF COND(&MSGQ *EQ '*USRPRF') THEN(DO) RTVUSRPRF USRPRF(*CURRENT) MSGQ(&MSGQ) MSGQLIB(&LIB) ENDDO IF COND(&MSGQ *EQ '*WRKSTN') THEN(DO) RTVJOBA JOB(&MSGQ) CHGVAR VAR(&LIB) VALUE('*LIBL') ENDDO IF COND(&MSGQ *EQ '*SYSOPR') THEN(DO) CHGVAR VAR(&MSGQ) VALUE('QSYSOPR') CHGVAR VAR(&LIB) VALUE('*LIBL') ENDDO /* Validate input */ CHKOBJ OBJ(&LIB/&MSGQ) OBJTYPE(*MSGQ) MONMSG MSGID(CPF9801) EXEC(GOTO CMDLBL(NO_FIND)) ALCOBJ OBJ((&LIB/&MSGQ *MSGQ *EXCL)) WAIT(0) MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(NO_ALC)) NXTMSG: + IF COND(&MSGID *NE ' ') THEN(DO) RCVMSG MSGQ(&LIB/&MSGQ) MSGTYPE(*COMP) MSGID(&MSGID) MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(DLCOBJ)) GOTO CMDLBL(NXTMSG) ENDDO DLCOBJ: + DLCOBJ OBJ((&LIB/&MSGQ *MSGQ *EXCL)) MONMSG MSGID(CPF0000) RETURN NO_ALC: + SNDPGMMSG MSG('Unable to allocate message queue' *BCAT &MSGQ) + MSGTYPE(*DIAG) GOTO CMDLBL(SNDESCMSG) NO_FIND: + SNDPGMMSG MSG('Unable to find message queue' *BCAT &MSGQ) + MSGTYPE(*DIAG) SNDESCMSG: + SNDPGMMSG MSGID(CPF0002) MSGF(QCPFMSG) MSGTYPE(*ESCAPE) ENDPGM
LATEST COMMENTS
MC Press Online