Designing WFL Jobs for Automatic Restarts

A WFL job is the only type of user process that automatically restarts if interrupted by a halt/load. If a halt/load occurs while a WFL job is executing, then the WFL job and its offspring are terminated. After the halt/load, the job recovers in one of two ways.

If the restarted WFL job was executing a checkpointed task at the time of the halt/load, then a process called JOBRESTART appears in the W (Waiting Entries) system command display. For information about how to respond to this waiting entry, refer to Restarting a Checkpointed Task later in this section.

If the job was not executing a checkpointed task at the time of the halt/load, the system begins execution of the job from the last point that a successful job rollout took place. A job rollout stores selected information about the job for use if the job is restarted. The system attempts a job rollout before each of the following statements:

ALTER

COPY

PRINT

RUN

ARCHIVE

LOG

PROCESS

START

CHANGE

MODIFY

PTD

WAIT

COMPILE

OPEN

REMOVE

 

Also, if any of the following statements contains an ACCEPT function, the system attempts a job rollout before the statement:

Assignment Statements

DO

WHILE

CASE

IF

 

Additionally, the system attempts job rollouts after each WAIT statement. The WAIT statement is the only statement for which the system attempts a rollout both before and after the statement.

Note that a job rollout can succeed only if no tasks are running. If a job rollout fails, and the system has to restart the job, then the system restarts the job from a previous job rollout. The following examples illustrate this point:

  • Suppose that at the time of the halt/load the WFL job is waiting for a single synchronous task to complete. Therefore, the last successful job rollout took place before the initiation of that task. After the halt/load, the WFL job resumes by executing the task initiation statement again. This creates a new task that is an instance of the same program.

  • Suppose that the WFL job initiates three asynchronous tasks before the halt/load, and all of these tasks are still in use when the halt/load occurs. Therefore, the last successful job rollout took place before the first asynchronous task was initiated. After the halt/load, execution resumes with the first of the three task initiation statements.

  • Suppose the WFL job initiated an asynchronous task called A and then another asynchronous task called B. Task A terminates while task B is still in use. Then, a halt/load also occurs while task B is still in use. Therefore, the last successful job rollout took place before A was initiated. After the halt/load, execution of the job resumes with the statement that initiated task A. This was the last point at which no in-use task existed, because task A still existed when task B was initiated.