Subtask creation and control

The control program creates a task when it initiates execution of the job step; this task is the job step task. You can create additional tasks in your program. If you do not, however, the job step task is the only task in a job being executed. The benefits of a multiprogramming environment are still available even with only one task in the job step; work is still being performed for other jobs when your task is waiting for an event, such as an input operation, to occur.

The advantage in creating additional tasks within the job step is that more of your tasks are competing for control than the single job step task. When a wait condition occurs in one of your tasks, it is not necessarily a task from some other job that gets control; it might be one of your tasks, a portion of your job.

The general rule is that you should choose parallel execution of a job step (that is, more than one task in a job step) only when a significant amount of overlap between two or more tasks can be achieved. Both the amount of time the control program takes to establish and control additional tasks and your increased effort to coordinate the tasks and provide for communications between them must be taken into account.

You can also use tasks in enclaves. An enclave is a transaction that can span multiple tasks and/or SRBs in one or more address spaces and is managed and reported as a unit. A task can join or leave an enclave. While a task is joined to an enclave, any subtasks created also belong to the enclave. For more information about using tasks in enclaves, see z/OS MVS Programming: Workload Management Services.

Most of the information concerning subtask creation and control appears in z/OS MVS Programming: Assembler Services Guide, z/OS MVS Programming: Assembler Services Reference ABE-HSP and z/OS MVS Programming: Assembler Services Reference IAR-XCT. This topic provides additional information about: