Skip to main content

Set Up Failure and Status Message Logic

An MCP job's status in Enterprise Manager Operation relies on several configuration settings: Fail Immediately on Fail Code, Send Fail/Reset Message, Task-Failure Checking, and Task-Completion Message. (Refer to the configuration file tables starting in Processing Variables (VAR).) If a job is not failed immediately, the internal JOB TO BE FAILED flag also plays an important role.

Job to be Failed Flag

The JOB TO BE FAILED flag, set per job, ultimately determines the final status of MCP jobs run through the LSAM. The LSAM checks this flag when the job terminates. If the flag is set to the default "N", the LSAM reports the job as successful. If the flag is set to "Y", the LSAM reports a job's failure, even if the operating system reports a job's success.

During the processing of a job or a task, a match between the console display and the words entered in the Fail Code or Fail Reset fields determines the JOB TO BE FAILED flag's setting. A Fail Code match sets the flag to "Y" and a Fail Reset match sets the flag back to "N". Refer to Failure Criteria in the Concepts online help. Regardless of the actual outcome of the job or tasks, the final value of the JOB TO BE FAILED flag decides the success or failure in Enterprise Manager Operation.

Fail Code and Fail Reset Logic

Use of Fail Codes is an alternative solution to programming a WFL to ABORT if a program IS NOT COMPLETED OK. Use of Fail Resets provides greater flexibility in assigning job statuses. For example, a critical application's success can reset the JOB TO BE FAILED flag despite the failure of other non-critical tasks. Refer to Failure Criteria in the Concepts online help.

The next table shows all the factors involved in using the Fail Code/Fail Reset feature. Use the table to configure the LSAM's behavior upon a Fail Code or Fail Reset match.

Fail Code/Fail Reset Conditions

Console MatchFail Immediately on Fail CodeJob to be FailedSend Fail/Reset MessageStatus Message
JJJJJ = Job Mix Number
TTTTT = Task Mix Number
Fail CodeYN/AN/AJJJJJ/TTTTTFAIL MSG
Fail CodeNSet to YA, FJJJJJ/TTTTTFAILCODE
Fail CodeNSet to YR, N<NONE>
Fail ResetNSet to NA, RJJJJJ/TTTTTRESETCODE
Fail ResetNSet to NF, N<NONE>

Task-Level Checking

Task-level checking enables the LSAM to report a job as failed to Enterprise Manager Operation when a job's subordinate task fails. Display messages issued by the job do not determine the job completion status; job completion status is determined solely by the completion status of the subordinate task(s). With task-level checking enabled, the failure of any single task in a WFL marks the job as failed or sets the JOB TO BE FAILED flag to Y.

If defined, Fail Codes and/or Fail Resets are applied to tasks regardless of the task-level checking setting. For more information on configuration settings, refer to Processing Variables (VAR). When the LSAM is configured to report at the task level (A or F), the Enterprise Manager's job history includes the completion status of each task.

The next table shows all the factors involved in task-level checking. Use the table to configure the LSAM's behavior upon a task's failure or success.

Task-Level Checking Conditions

TaskTask-Level CheckingJob to be FailedTask-Completion MessageStatus Message
JJJJJ = Job Mix Number
TTTTT = Task Mix Number
FAILIN/AN/AJJJJJ/TTTTTTASK FAIL
FAILTSet to YA, FJJJJJ/TTTTTTASK FAIL
FAILTSet to YN<NONE>
FAILTSet to NF, N<NONE>
OKI,TN/AAJJJJJ/TTTTTCOMP OK
OKI,TN/AF, N<NONE>

Final Status

If a job is not failed immediately, the JOB TO BE FAILED flag determines the success or failure of a job in Enterprise Manager Operation. If the flag is set to Y for multiple reasons, Enterprise Manager Operation takes the last job or task status. If the flag is N, then the job's final status is JJJJJCOMPLETED.

Job To Be Failed Flag Effects

Job to be FailedFinal StatusStatus Message
JJJJJ = Job Mix Number
TTTTT = Task Mix Number
Set to YFAILEDJJJJJ/TTTTTFAIL MSG
Set to YFAILEDJJJJJ/TTTTTTASK FAIL
Set to NFINISHED OKJJJJJCOMPLETED