AS400 -- how to manage Jobs that remains in MSGW

Discussion created by Pascal_Osthus-bugat_1753 on Mar 31, 2017
Jobs submitted on AS400 can remain in Message Wait status. This depends from the occurrence of an unexpected event (e. g. file not found), in case the programmer in his code has allowed the trapping of this kind of events. This program can remain in MSGW status undefinitely, unless specific action is done by a user.

This program call CALL PGM(POSDEV/CLP_MSGW) PARM('AUTOMIC001') is executed as a task by a V10 AS400 agent on this sytem. This program is coded to throw an exception and to remain in Message Wait (MSGW) status.

This task has been executed and will remain in Running Status indefinitely.


In the Active Job Panel (WRKACTJOB) we see that the job in status MSGW:


Check the User’s Message Queue: DSPMSG MSGQ(UNIVADM), the System informs the User that a message needing a reply is waiting in the QSYSOPR Message Queue (please note that UNIVADM is the user in LOGIN object assigned in One Automation to this job):


Verify the Message Queue of QSYSOPR :  DSPMSG MSGQ(QSYSOPR). A message needing a reply is present.


Option 5 allow to open the Message and to provide a Reply, which will decide of the End Status of the Job


The Reply Menu offers 4 different choices, C or 'Cancel', R for 'Replay', D for a 'Dump Creation' and I for 'Ignore'.


Type ‘C’ for Cancel, the Job will then continue its life and ends with ENDED_NOT_OK


Type ‘I’ for Ignore, the Job will then continue its life and ends with ENDED_OK


Hint: If you want to check One Automation for jobs in MSGW status (Version 10) run the coming Query.


Finally: Even if it might appear as unusual to beginner on AS400, this behavior is exactly the same of what we experience on a Windows system when the program stops its execution and throws an message box, informing that an unexpected event occured and asking if the program should continue or not.