How MAXDELAY Affects PROCESS Submission
When the Server constructs and writes the PROCESS to the TCQ , the Server does not communicate the results or process number back to the API; instead, it places the API in a WAIT status. The API waits until the PROCESS completes its execution; it does not know the process number assigned. The API remains in WAIT status and is dependent on the positional parameter defined with the MAXDELAY, unlimited, queued, time value or 0 (zero).
If set as unlimited or MAXDELAY UNLIMITED, the API connection will be in WAIT status until the PROCESS completes execution and is removed from the TCQ. In the event of an error that causes that PROCESS to be placed into the HOLD queue, the API connection will remain in WAIT until manual action is taken for that held PROCESS.
When queued, time value, or MAXDELAY QUEUED, the API connection will be in WAIT until the PROCESS completes execution or is removed from the TCQ or the time interval expires. If the PROCESS executes longer than that specified time, or is placed into the HOLD queue the API will not get the complete or expected results. If 0 (zero) or MAXDELAY ZERO, the API connection will be in WAIT until the PROCESS completes execution and is removed from the TCQ. However, if an error occurs that would normally place the PROCESS into the HOLD queue, the MAXDELAY ZERO PROCESS is removed from the queue and the API is posted complete with an error. An API connection cannot be in WAIT forever with MAXDELAY UNLIMITED.