IBM i job in MSGW status: find the message and reply to it
MSGW in WRKACTJOB means the job waits on a message, usually an inquiry that needs a reply. Use option 7 to see and answer it, or reply from QSYSOPR with DSPMSG.
In WRKACTJOB, a status of MSGW means the job is waiting for a message from a message queue. Almost always it has sent an inquiry message, an error or question that needs an answer, and it stops until someone replies. A batch job in MSGW can hold up everything queued behind it.
See the message and reply
- Run
WRKACTJOB, find the job, and type 7 (Display message) next to it. - The message is shown with a reply line. Put the cursor on the message and press
F1for the full text, which usually lists the replies it accepts. - Type the reply and press
Enter. The job carries on.
Inquiries from batch jobs are often sent to the QSYSOPR message queue, so an operator can answer them with DSPMSG QSYSOPR (or WRKMSG QSYSOPR) by typing on the reply line under the message. Interactive jobs show the inquiry on their own screen.
If you remove an inquiry message instead of answering it, the system sends its default reply. That is not always the answer you want, so read the message first.
Find every job in MSGW
On a busy system, WRKACTJOB SEQ(*STS) sorts the list by status, so MSGW jobs sit together. Or use SQL:
SELECT JOB_NAME, AUTHORIZATION_NAME, SUBSYSTEM
FROM TABLE(QSYS2.ACTIVE_JOB_INFO()) X
WHERE JOB_STATUS = 'MSGW'
With the function's detailed information turned on, its MESSAGE_REPLY column also says whether the job waits for a reply to a specific message (YES) or only for a message to arrive on a queue (NO).
Stop the same message from stopping the job
The job attribute INQMSGRPY decides what happens to inquiries:
*RQD: someone must reply. This is how most jobs run.*DFT: every inquiry gets its default reply at once.*SYSRPYL: the system reply list is checked first, and a matching entry answers automatically. With no match, a reply is still needed.
WRKRPYLE shows the system reply list. IBM ships a few generic entries in it, CPA0700, RPG0000, CBE0000 and PLI0000. Add your own with ADDRPYLE, and run the job with INQMSGRPY(*SYSRPYL), set on SBMJOB, CHGJOB or the job description. Read what each reply does before you make it automatic, because the same reply is then sent every time that message appears.
To end the job instead of answering, see End a stuck IBM i job: ENDJOB CNTRLD, IMMED and ENDJOBABN.
Related
- IBM i Message Waiting light stays on: DSPMSG and delivery modes
- End a stuck IBM i job: ENDJOB CNTRLD, IMMED and ENDJOBABN
- Automate IBM i green-screen tasks: job scheduler, SBMJOB, SSH and screen scripts
- IBM i CL basics
- IBM i job log missing or empty: CHGJOB LOG, LOGCLPGM and pending job logs
Sources
- IBM Support: Understanding what controls the automatic reply function
- IBM i 7.5: ACTIVE_JOB_INFO table function, MSGW and MESSAGE_REPLY
- IBM i 7.5: Work with Active Jobs (WRKACTJOB)
- IBM i 7.5: Display Messages (DSPMSG)
- IBM i 7.5: Work with Reply List Entries (WRKRPYLE)
- IBM i 7.5: Add Reply List Entry (ADDRPYLE)
- IBM i 7.5: Change Job (CHGJOB), INQMSGRPY