Here are the stages of JCL job execution. ZO/S uses Job Entry Sub-system (JES) to process jobs into the operating system.
Input Phase
JES2 jobs can be entered on input devices such as card readers, remote terminals, or other programs. Jobs can also come from other nodes in a job entry network and from internal readers. (An internal reader is a program that other programs can use to submit jobs, control statements, and commands to JES2.)
Conversion Phase
JES2 uses a converter program to analyze each job’s JCL statements and to perform a syntax check. It also determines if the JCL includes any procedure calls. If so, the converter takes the job’s JCL and merges it with the JCL from the procedure library (for example, SYS1.PROCLIB), and converts the composite JCL into internal text.
Execution Phase
Before work can be processed on a z/OS system, initiators have to be started. An initiator is started either by an operator or automatically by JES2 when the system is initialized. If an initiator is ready to process work, it requests a job from JES2.
JES2 selects jobs based on the job classes that are assigned to the initiator and the priority order in which the job classes should be searched. When JES2 selects a job, it passes it to the initiator. The initiator then invokes the interpreter to build control blocks from the internal text that the converter created for the job.
The initiator allocates the resources specified in the JCL for the first step of the job. This allocation ensures that the devices are available before the job step starts running. The initiator then starts the program requested in the JCL EXEC statement.
Output Phase
JES2 controls all output processing, that is, 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.
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






