TechTalk: Removing Job Completion Messages

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: