Setting error codes using completion codes

HCL Workload Automation for Z sets error codes using completion codes when they are available. This is how HCL Workload Automation for Z derives the error code from the completion code:
  • If the job or started task did not abend, the completion code is converted to a 4-digit number. The z/OS® completion code 8, for example, is converted to the HCL Workload Automation for Z error code 0008. This also depends on the values specified on EWTROPTS.
  • If the job or started task failed with a system completion code, the abend code (from the step-end SMF record) is set as the error code. System completion code 0C4, for example, becomes error code S0C4.
  • If the job or started task failed with a user abend code, the code (from the step-end SMF record) is converted to a character string of the format Uxxx, where xxx is three hexadecimal digits. User abend 2750, for example, is converted to error code UABE. That is, the decimal value of the abend code, as displayed in the job log, is converted to hexadecimal representation.
  • In certain cases, HCL Workload Automation for Z does not use the completion code of a job or started task to set the error code. Instead, it sets one of its own error codes. For the complete list of error codes, see Status, error, and reason codes.
Note:
  1. If more than one step in a job or started task has abended, the operation error code is created from the abend code of the first step that failed.
    An exception to this rule is when you set RETCODE(LAST). In this case:
    • If all the steps fail, the operation error code is created from the abend code of the last step that failed.
    • If all the steps fail, except for the last one, which flushed, the operation error code is created from the abend code of the first step that failed.
  2. HCL Workload Automation for Z converts only the three right-most hexadecimal digits. Therefore, the highest possible return code is 4095 (X'FFF'). If you pass a return code that is greater than 4095, an invalid return code could be set or invalid return code testing performed.