Chapter 7: Batch processing and the Job Entry Subsystem (JES)

Download Report

Transcript Chapter 7: Batch processing and the Job Entry Subsystem (JES)

Introduction to z/OS Basics
Chapter 7: Batch processing and the Job Entry
Subsystem (JES)
Batch processing and JES
© 2006 IBM Corporation
Chapter 07 Batch and JES
Chapter objectives
 Be able to:

Give an overview of
batch processing and
how work is initiated
and managed in the
system.
 Explain how the job
entry subsystem (JES)
governs the flow of
work through a z/OS
system.
2
© 2006 IBM Corporation
Chapter 07 Batch and JES
Key terms in this chapter
3
 batch processing
 procedure
 execution
 purge
 initiator
 queue
 job
 spool
 job entry
subsystem (JES)
 symbolic reference
 output
 workload manager
(WLM)
© 2006 IBM Corporation
Chapter 07 Batch and JES
Job Management
4
© 2006 IBM Corporation
Chapter 07 Batch and JES
What is batch processing?
 Much of the work running on z/OS consists of programs called batch
jobs.
 Batch processing is used for programs that can be executed:
– With minimal human interaction
– At a scheduled time or on an as-needed basis.
 After a batch job is submitted to the system for execution, there is
normally no further human interaction with the job until it is
complete.
 Use Job Control Language (JCL) to tell the computer what to do
– Who your are
– What program to run
– Where input and output are located
– When a job is to run
5
© 2006 IBM Corporation
Chapter 07 Batch and JES
What is JES?
 Job Entry Subsystem
 In the z/OS operating system, JES manages the input
and output job queues and data.
 JES handles the following aspects of batch processing
for z/OS:
– Receives jobs into the operating system
– Schedules them for processing by z/OS
– Controls their output processing
6
© 2006 IBM Corporation
Chapter 07 Batch and JES
What is JES? (continued)
 z/OS offers two types: JES2 and JES3
 Some important differences, but both JES2 and JES3:
– Accept and queue jobs submitted for execution
•
•
•
•
From ISPF through the SUBMIT command
Over the network
From a running program
From a card reader – very rare
– Queue jobs waiting to be executed
– Queue jobs for an initiator -- a JES program that requests the next
job in the queue
– Accept output from a job while it is running and queue the output
– Can print the output, or save it on spool for an output manager to
retrieve.
7
© 2006 IBM Corporation
Chapter 07 Batch and JES
Why do we need JES
8
© 2006 IBM Corporation
Chapter 07 Batch and JES
JES FUNCTIONS
9
© 2006 IBM Corporation
Chapter 07 Batch and JES
JCL Related Actions
10
© 2006 IBM Corporation
Chapter 07 Batch and JES
Phases of Job Processing
11
© 2006 IBM Corporation
Chapter 07 Batch and JES
Batch flow (simplified)
JCL Processing
JES
JOBs
Initiator
- Allocation
Initiator
- Execution
submit
SPOOL
SPOOL
- Allocation
- Cleanup
- Execution
- Cleanup
Printer
12
© 2006 IBM Corporation
Chapter 07 Batch and JES
What is spooling?
 Spooling is a method for queuing and holding data
for input or output.
 JES uses one or more disk data sets for spooling.
 Input jobs and printed output from many jobs are
stored in the single (conceptual) spool data set.
13
© 2006 IBM Corporation
Chapter 07 Batch and JES
What an initiator does

To run multiple jobs asynchronously, z/OS uses
initiators to:
– Ensure that jobs do not conflict in data set usage
– Ensure that single-user devices (tape drives) are allocated
correctly
– Find executable programs requested by jobs
– Clean up after the job ends and request the next job

14
Preventing two users from accessing the
same data at the same time is critical to z/OS and
the ability to do this is one of the defining
characteristics of the operating system.
© 2006 IBM Corporation
Chapter 07 Batch and JES
Symbolic references to files
 z/OS normally uses symbolic references to files
(data sets) rather than actual file names.
 The use of symbolic references provides a naming
redirection between a data set-related name used
in a program and the actual data set used during
execution of that program.
15
© 2006 IBM Corporation
Chapter 07 Batch and JES
How a symbolic file system is used
DDNAME
program
DSNAME
JCL for JOB
OPEN FILE=XYZ
READ FILE=XYZ
//XYZ DD DSNAME=MY.PAYROLL
...
CLOSE FILE=XYZ
16
MY.PAYROLL
© 2006 IBM Corporation
Chapter 07 Batch and JES
How a symbolic file system is used (continued)
DDNAME
program
DSNAME
JCL for JOB
OPEN FILE=XYZ
READ FILE=XYZ
//XYZ DD DSNAME=DIV1.PAYROLL
DIV1.PAYROLL
...
CLOSE FILE=XYZ
17
© 2006 IBM Corporation
Chapter 07 Batch and JES
JES, job management, and JCL
 Job control language (JCL) is the language used by a batch job
to request resources and services from the operating system.
 Through JCL, you specify:
– Who you are (important for security reasons).
– Which resources (programs, files, memory) and services are
needed from the system to process your program.
 The use of JCL is covered in detail in the next module.
 Example Batch job follows
18
© 2006 IBM Corporation
Chapter 07 Batch and JES
Procedure to Compile, link-edit, and execute programs
000010 //IGYWCLG PROC LNGPRFX='IGY.V3R2M0',SYSLBLK=3200,
000020 // LIBPRFX='CEE',GOPGM=GO
000030 //*
000040 //*********************************************************************
000050 //* *
000060 //* Enterprise COBOL for z/OS and OS/390 *
000070 //* Version 3 Release 2 Modification 0 *
000080 //* *
000090 //* LICENSED MATERIALS - PROPERTY OF IBM. *
000100 //* *
000110 //* 5655-G53 5648-A25 (C) COPYRIGHT IBM CORP. 1991, 2002 *
000120 //* ALL RIGHTS RESERVED *
000130 //* *
000140 //* US GOVERNMENT USERS RESTRICTED RIGHTS - USE, *
000150 //* DUPLICATION OR DISCLOSURE RESTRICTED BY GSA *
000160 //* ADP SCHEDULE CONTRACT WITH IBM CORP. *
000170 //* *
000180 //*********************************************************************
19
© 2006 IBM Corporation
Chapter 07 Batch and JES
Procedure to Compile, link-edit, and execute programs
000190 //*
000300 //COBOL EXEC PGM=IGYCRCTL,REGION=2048K
Identifies COBOL compiler
000310 //STEPLIB DD DSNAME=&LNGPRFX..SIGYCOMP,
000320 // DISP=SHR
000330 //SYSPRINT DD SYSOUT=*
000340 //SYSLIN DD DSNAME=&&LOADSET,UNIT=SYSDA, Describes output of compiler
000350 // DISP=(MOD,PASS),SPACE=(TRK,(3,3)),
000360 // DCB=(BLKSIZE=&SYSLBLK)
000370 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
000440 //LKED EXEC PGM=HEWL,COND=(8,LT,COBOL),REGION=1024K
000450 //SYSLIB DD DSNAME=&LIBPRFX..SCEELKED, Second Step: perform link-edit
000460 // DISP=SHR
000470 //SYSPRINT DD SYSOUT=*
000480 //SYSLIN DD DSNAME=&&LOADSET,DISP=(OLD,DELETE)
000490 // DD DDNAME=SYSIN
000500 //SYSLMOD DD DSNAME=&&GOSET(&GOPGM),SPACE=(TRK,(10,10,1)),
000510 // UNIT=SYSDA,DISP=(MOD,PASS)
000520 //SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(10,10))
000530 //GO EXEC PGM=*.LKED.SYSLMOD,COND=((8,LT,COBOL),(4,LT,LKED)),
20
© 2006 IBM Corporation
Chapter 07 Batch and JES
Procedure to Compile, link-edit, and execute programs
000540 // REGION=2048K
000550 //STEPLIB DD DSNAME=&LIBPRFX..SCEERUN,
000560 // DISP=SHR
000570 //SYSPRINT DD SYSOUT=*
000580 //CEEDUMP DD SYSOUT=*
000590 //SYSUDUMP DD SYSOUT=*
21
© 2006 IBM Corporation
Chapter 07 Batch and JES
Related actions with JCL
IT USER ACTIONS
Determine
the need
and
characteristics
of the Job
Create
the JCL
SYSTEM ACTIONS
JES interprets
JCL and
passes it to
z/OS initiator
Submit
the Job
z/OS
manages
each step
of execution
System
Messages
User
views
and
interprets
output
22
JES prints
output
JES collects
the output and
information
about the Job
© 2006 IBM Corporation
Chapter 07 Batch and JES
Spooling
Spooling is the means by which the system manipulates its work.
• Using storage on direct access storage devices as buffer storage to
reduce processing delays
• Reading and writing input and output streams on an intermediate device
• Performing an operation such as printing while the computer is busy.
JCL
program
read
JES 1
2
//DD1 DD *
……...............
data
……...............
/*
spool
//DD2
DD SYSOUT=A
JES 4
SYSOUT
write
3
Used to improve performance of computer
23
Printer
© 2006 IBM Corporation
Chapter 07 Batch and JES
Two-step job
Make a backup copy of one
master file and then update
the master file with records
read in from another file
(update file).
1. Read master file and write
it to tape
First step
Master
Second step
Master
Updates
Program
Program
2. Read record from update
file and search for it in the
master file.
Tape
1. Update record if
found, otherwise adds
new record
24
Master
Printer
© 2006 IBM Corporation
Chapter 07 Batch and JES
Build a Job with Two Steps that Specify:
 Who you are
 What resources are needed by the job, such as the following:
– Load the backup program (that you already have compiled).
– How much memory the system needs to allocate to accommodate the
backup program, I/O buffers, and working areas.
– Make accessible to the backup program an output tape data set to
receive the backup, a copy, and the master file data set itself.
– At program end indicate to the operating system that now your update
program needs to be loaded into memory (however, this should not be
done if the backup program failed).
– Make accessible to the update program the update file and master
file.
– Make accessible to your program a printer for eventual messages.
25
© 2006 IBM Corporation
Chapter 07 Batch and JES
Job flow through the system
 During execution, a job goes through the following
phases:
– Input
– Conversion
– Processing
– Output
– Print (to hardcopy or a console display)
– Purge
26
© 2006 IBM Corporation
Chapter 07 Batch and JES
Phases of job flow: input
Input: Accepts job in form of input stream
Conversion: analyze and merge JCL with
library procedures
JOB
CONVERSION
QUEUE
INPUT
JCL & SYSIN
27
CONVERSION
PROCESSING
OUTPUT
HARD-COPY
PURGE
SPOOL
DISK
© 2006 IBM Corporation
Chapter 07 Batch and JES
Phases of job flow: conversion
JOB
INPUT
CONVERSION
QUEUE
EXECUTION
QUEUE
CONVERSION
PROCESSING
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.
OUTPUT
HARD-COPY
PURGE
JCL
SPOOL
DISK
28
© 2006 IBM Corporation
Chapter 07 Batch and JES
Phases of job flow: execution
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
JOB
INPUT
CONVERSION
EXECUTION
QUEUE
OUTPUT
QUEUE
PROCESSING
OUTPUT
SYSIN
HARD-COPY
PURGE
SYSOUT
SPOOL
DISK
29
© 2006 IBM Corporation
Chapter 07 Batch and JES
Phases of job flow: output and hardcopy
JOB
INPUT
Output: JES2 controls all SYSOUT
processing. SYSOUT is system-produced
output; that is, all output produced by, or
for, a job.
CONVERSION
PROCESSING
OUTPUT
QUEUE
HARD-COPY
QUEUE
PURGE
QUEUE
OUTPUT
HARD-COPY
PURGE
Hardcopy: JES2 selects output for
processing from the output queues by
output class, route code, priority, and other
criteria.
SYSOUT
NON-PRINT/PUNCH
OUTPUT
SPOOL
DISK
30
© 2006 IBM Corporation
Chapter 07 Batch and JES
Phases of job flow: purge
JOB
PURGE
QUEUE
INPUT
CONVERSION
PROCESSING
SPOOL
DISK
31
OUTPUT
HARD-COPY
PURGE
Purge: 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.
© 2006 IBM Corporation
Chapter 07 Batch and JES
Job flow through the system
JOB
INPUT
CONVERSION
QUEUE
EXECUTION
QUEUE
OUTPUT
QUEUE
HARD-COPY
QUEUE
PURGE
QUEUE
CONVERSION
PROCESSING
OUTPUT
HARD-COPY
PURGE
SYSIN
SYSOUT
SYSOUT
Network job entry
(NJE)
JCL
JCL & SYSIN
32
SPOOL
DISK
© 2006 IBM Corporation
Chapter 07 Batch and JES
JES2 compared to JES3
 In a multi-processor configuration:
 JES2:
– Each JES2 processor controls its own job input, job scheduling, and
job output processing.
– It is possible to configure JES2 to share spool and checkpoint data
sets with other JES2 systems (multi-access spool or MAS).
 JES3:
– Centralized control over processing through a single global JES3
processor, which does job selection, scheduling, and device
allocation the other JES3 systems.
– The centralized control of JES3 provides increased job scheduling
control, deadline scheduling capabilities, and increased control by
providing its own device allocation.
 Most installations use JES2, as do the examples in this text.
33
© 2006 IBM Corporation
Chapter 07 Batch and JES
What is workload manager?
 Workload manager (WLM):
 The component of z/OS that manages the
processing of workload in the system according to
the company’s business goals, such as response
time.
 Also manages the use of system resources, such
as processors and storage, to accomplish these
goals.
34
© 2006 IBM Corporation
Chapter 07 Batch and JES
Summary
 Batch processing is a fundamental function of
z/OS.
 z/OS shares with JES the management of jobs and
resources.
 JES receives jobs into the system, schedules them
for processing, and controls their output.
 JES manages jobs in queues.
 An initiator sets up the necessary environment for
running a batch job. Multiple initiators permit the
parallel execution of batch jobs.
 During the life of a job, both JES and the z/OS base
control program control different phases of the
overall processing.
35
© 2006 IBM Corporation