ON FAILURE
For each phase, you can specify a particular return code to use when a failure occurs in that phase. Alternatively, you can specify ALL to indicate what return code to use when a failure occurs in any of the execution phases. For example, the following specification indicates that a failure in any phase should terminate with return code 12:
The default for this option is ON FAILURE ALL TERMINATE UTILITY. In this case, if UNLOAD PLUS encounters a failure in any phase, the job terminates with the highest assigned return code.
TERMINATE UTILITY
When TERMINATE UTILITY is in effect for an abend that occurs during any or all of the UTILINIT, UNLOAD, or UTILTERM phases, UNLOAD PLUS completes the following tasks:
- Deletes the row that contains the utility ID from the BMCUTIL, (BMC.DB2.SPE2404)BMCUTIL2, and BMCSYNC tables
- Issues either the normal return code or the one that you specify with the RETCODE option
- With the following exceptions, deletes the SYSREC, SYSRED, SORTWK, and referenced files if you have specified DELETEFILES YES:
- If DIRECT NO is in effect, UNLOAD PLUS does not delete any referenced files.
- UNLOAD PLUS does not delete any HFS-referenced files.
- If you are running the unload job in a worklist environment, UNLOAD PLUS deletes only the dynamically allocated SYSREC, SYSRED, and referenced file data sets.
Multiple statements
When you specify multiple ON FAILURE statements, UNLOAD PLUS functions as follows:
- For competing ON FAILURE statements, UNLOAD PLUS honors the last statement.
- When a phase-specific ON FAILURE statement follows an ON FAILURE ALL statement, UNLOAD PLUS honors the phase-specific statement for that phase and the ON FAILURE ALL statement for the remaining phases.
In the following example, a failure in any phase results in return code 20, overriding the first statement:
ON FAILURE ALL TERMINATE UTILITY RETCODE 20
If you reverse these statements (next example), a failure in the UNLOAD phase results in return code 25, and a failure in the UTILINIT or UTILTERM phase results in return code 20:
ON FAILURE UNLOAD TERMINATE UTILITY RETCODE 25
RETCODE | This option allows you to specify which return code UNLOAD PLUS should issue when an abnormal termination occurs during the phase that you specified with TERMINATE UTILITY. Valid values are 0 through 4095. Additional considerations The following considerations apply to this option:
|
---|
STOP UTILITY
In versions 10.2 and later, UNLOAD PLUS no longer honors this syntax. If you specify STOP UTILITY, UNLOAD PLUS changes the syntax to TERMINATE UTILITY and issues the message BMC51704I.
In versions 10.1 and earlier, if you specified STOP UTILITY for an abend that occurred during the UTILINIT, UNLOAD, or UTILTERM phase, UNLOAD PLUS stopped the job and left the utility ID in the BMCUTIL and BMCSYNC tables.