title: Monitor and handle MSGW messages on a job on an IBM i-series (AS/400) from Java
body: <p>Does anyone know how one can automatically reply to messages with status MSGW that block a job on an IBM i-series (AS/400)?</p>
  
  <p>I'm using the jt400/jtopen library to access a program on an AS/400 from Java. I'm using the com.ibm.as400.access.ProgramCall class, which works fine, unless the program fails for some reason. As with almost any program, failures will happen sometimes, but unfortunately, in this case, it does not result in a status message or an exception. Instead, the calling thread just hangs. What's worse, any call to the AS/400 to get information on the Job (another class in jt400 that mostly does what you would expect) backing the queue will hang as well. </p>
  
  <p>I could of course monitor the thread in which the call runs and simply kill it after waiting for a while, but that's a last resort. Getting an error message back from the system would be nice. </p>