During the life of a job, JES2 and the base control program of z/OS® control
different phases of the overall processing.
The job queues contain jobs that are waiting to run, currently running,
waiting for their output to be produced, having their output produced, and
waiting to be purged from the system.
Generally speaking, a job goes through the following phases:
- Input
- Conversion
- Processing
- Output
- Print/punch (hard copy)
- Purge
During batch job processing, numerous checkpoints occur. A checkpoint
is a point in processing at which information about the status of a job and
the system can be recorded (in a file called a checkpoint data set). Checkpoints
allow the job step to be restarted later if it ends abnormally due to an error.
Figure 1 shows the different phases
of a job during batch processing.
Figure 1. Job flow through the system
- Input phase
- JES2 accepts jobs, in the form of an input stream, from input devices,
from other programs through internal readers, and from other nodes in a job
entry network.
The internal reader is a program that other programs can
use to submit jobs, control statements, and commands to JES2. Any job running
in z/OS can
use an internal reader to pass an input stream to JES2. JES2 can receive multiple
jobs simultaneously through multiple internal readers. The system programmer
defines internal readers to be used to process all batch jobs other than started
tasks (STCs) and TSO requests.
JES2 reads the input stream and assigns
a job identifier to each JOB JCL statement. JES2 places the job's JCL, optional
JES2 control statements, and SYSIN data onto DASD data sets called spool data
sets. JES2 then selects jobs from the spool data sets for processing and subsequent
running.
- Conversion phase
- JES2 uses a converter program to analyze a job's JCL statements. The converter
takes the job's JCL and merges it with JCL from a procedure library. The procedure
library can be defined in the JCLLIB JCL statement, or system/user procedure
libraries can be defined in the PROCxx DD statement of the JES2 startup procedure.
- Then, JES2 converts the composite JCL into converter/interpreter text
that both JES2 and the initiator can recognize.
- Next, JES2 stores the converter/interpreter text on the spool data set.
If JES2 detects any JCL errors, it issues messages, and the job is queued
for output processing rather than execution. If there are no errors, JES2
queues the job for execution.
- Processing phase
- In the processing phase, JES2 responds to requests for jobs from the initiators.
JES2 selects jobs that are waiting to run from a job queue and sends them
to initiators.
An initiator is a system program belonging to z/OS, but controlled
by JES or by the workload management (WLM) component of z/OS, which starts
a job allocating the required resources to allow it to compete with other
jobs that are already running.
JES2 initiators are initiators that are
started by the operator or by JES2 automatically when the system initializes.
They are defined to JES2 through JES2 initialization statements. To obtain
an efficient use of available system resources, the installation associates
each initiator with one or more job classes. Initiators select jobs whose
classes match the initiator-assigned class, obeying the priority of the queued
jobs.
WLM initiators are started by the system automatically based on
performance goals, relative importance of the batch workload, and the capacity
of the system to do more work. The initiators select jobs based on their service
class and the order in which they were made available for execution. Jobs
are routed to WLM initiators through a JOBCLASS JES2 initialization statement.
- Output phase
- JES2 controls all SYSOUT processing. SYSOUT is system-produced output;
that is, all output produced by, or for, a job. This output includes system
messages that must be printed, as well as data sets requested by the user
that must be printed or punched. After a job finishes, JES2 analyzes the characteristics
of the job's output in terms of its output class and device setup requirements;
then JES2 groups data sets with similar characteristics. JES2 queues the output
for print or punch processing.
- Print/punch (hard copy) phase
- JES2 selects output for processing from the output queues by output class,
route code, priority, and other criteria. The output queue can have output
that is to be processed locally or at a remote location. After processing
all the output for a particular job, JES2 puts the job on the purge queue.
- Purge phase
- When all processing for a job completes, JES2 releases the spool space
assigned to the job, making the space available for allocation to subsequent
jobs. JES2 then issues a message to the operator indicating that the job has
been purged from the system.