This course introduces
IBM's Job Control Language, commonly referred to as JCL. If you are a new user,
JCL probably looks very complex. In fact, writing your program may look simple
next to coding the JCL needed to run your job.
Well, worry no more. This course will end the mystery of coding JCL. It presents the concepts, coding rules and statements you need to run your programs.
This unit is a basic introduction to JCL. You'll learn what statements do and how they are coded. You'll look at the general structure of a JCL statement. The unit also describes JCL's relationship to the operating system and contrasts JCL to application programs.
After completing this unit, you should be able to:
Whether you are a programmer, operator, manager, or end user, Job Control Language, called JCL, is the language that you need to do your work on the computer.
By submitting a job or requesting that one be submitted for processing, you are requesting work from the operating system. You must state who you are, what you want, who to charge it to, and so on.
You do this with JCL.
Let's start now by defining basic terms.
*Jobs and Jobstreams
A job is a unit of work performed by the computer system. Typically, a job is a specific processing task or group of related processing tasks.
Jobs are submitted to the computer system for processing via JCL (Job Control Language).
You refer to a series of JCL statements as a jobstream or input stream.
*The Operating System
The operating system (OS) supervises all jobs submitted to the computer system for processing. Two operating system components are:
As you proceed through the JCL series, you'll learn JCL options that communicate with JES.
A jobstream is constructed with the job control statements needed to define your job, your program and the resources required.
Data sets and printers are examples of resources you might need.
Three basic JCL statements provide these services. The following pages show a typical jobstream.
*Identifying the Job
The job identifier defines
*Executing and Defining
Each program executed by the job is named.
Each file accessed by the program is associated with a physical data set definition:
*Start with JOB
Each JCL statement has a unique identifier: JOB, EXEC and DD are the most common.
The placement of the JCL statements is important.
A job must start with a JOB statement and...
EXEC and DD
... be followed by its job steps.
Each job step must start with an EXEC and be followed by its DD statements.
The DD statements may be in any order following the EXEC statement.
*Job Steps
Each executed program begins another job step.
And each data set needed in that step must be defined in a DD statement following the EXEC statement.
Now that you have an idea of what JCL is and what it is used for, take a look at its general format.
//name operation operands comments
*Identifying JCL
//
The operating system identifies JCL as JCL (not data or a program) by the // in positions 1 and 2 of the statement.
These positions are the first two character positions starting the line of JCL you're coding.
*What's in a Name?
//name
The name field is in some cases optional, but more frequently is required. The name field is used either:
*The Operation
//name operation
The operation field defines the type of statement. Common statement types include:
// JOB statement to identify a job
// EXEC statements to request a program
// DD statements to define a data set
// statement to end a job (called a null statement)
Several other statement types exist. Some are covered in this course. Others are covered in subsequent courses.
*Operands
//name operation operands
The operands are parameters coded to define the services required by the program. Operands describe, for example:
*Comments
//name operation operands comments
You may enter any type of comment desired.
JCL must be coded carefully and correctly. The operating system cannot guess what you mean. You must code precisely what you want.
So far you have learned that JCL requests a program to be executed and defines the resources the program needs.
It is just another programming language that can be thought of as a control language.
This section explores how JCL differs from a program.
*Programs
First, let's look at what programs are.
A program is a set of instructions in a computer-readable language that controls what a computer does, step by step. Programs are usually written in a high-level language – one with instructions more like readable English.
COBOL, for example, is such a language. These programs are restructured by a compiler to a language format executable by the computer.
*Comparing the Two
Compare that to JCL.
JCL is written as a series of statements that tell a computer what program to execute and what resources will be needed.
The JCL is submitted to the computer just as it was coded. The operating system interprets what was coded for its use.
*Sample Program
In this section you'll walk through these steps for a program that updates a payroll master file.
*The Role of JCL
To execute the payroll program, JCL must define the following:
*Examining the DifferencesYou'll continue your examination of the differences between a program and JCL by looking at what's involved in running the program to update the payroll master file.
You'll see the roles of the program and the JCL statements in this process. Now let's go on.
*JCL Is in Control
JCL performs a necessary system requirement.
It allows any number of data sets to be accessed or created by one program.
The program is written with a logical view of what the data looks like. JCL assigns the physical characteristics such as name, location, and size.
This way, the same program can access the data set stored on disk for regular daily processing or stored on a backup tape for a recovery procedure.
Well, worry no more. This course will end the mystery of coding JCL. It presents the concepts, coding rules and statements you need to run your programs.
This unit is a basic introduction to JCL. You'll learn what statements do and how they are coded. You'll look at the general structure of a JCL statement. The unit also describes JCL's relationship to the operating system and contrasts JCL to application programs.
After completing this unit, you should be able to:
- Define basic terminology
- Explain the construction of a typical jobstream
- Describe the format of a JCL statement
- Distinguish between the functions of JCL and programs
Topic 1.1: What Is JCL?
*The Language of WorkWhether you are a programmer, operator, manager, or end user, Job Control Language, called JCL, is the language that you need to do your work on the computer.
By submitting a job or requesting that one be submitted for processing, you are requesting work from the operating system. You must state who you are, what you want, who to charge it to, and so on.
You do this with JCL.
Let's start now by defining basic terms.
*Jobs and Jobstreams
A job is a unit of work performed by the computer system. Typically, a job is a specific processing task or group of related processing tasks.
Jobs are submitted to the computer system for processing via JCL (Job Control Language).
You refer to a series of JCL statements as a jobstream or input stream.
*The Operating System
The operating system (OS) supervises all jobs submitted to the computer system for processing. Two operating system components are:
Component | Description |
---|---|
BCP Base Control Program |
BCP controls the job's execution. It is not the focus of this course. |
JES Job Entry Subsystem |
JES reads your job, interprets the JCL, prints the output and purges the job. JES also performs housekeeping functions for the spool space and the job queues. |
As you proceed through the JCL series, you'll learn JCL options that communicate with JES.
Topic 1.2: Introduction to Jobstreams
*Basic StatementsA jobstream is constructed with the job control statements needed to define your job, your program and the resources required.
Data sets and printers are examples of resources you might need.
Three basic JCL statements provide these services. The following pages show a typical jobstream.
*Identifying the Job
The job identifier defines
- Jobname
- Submitter
- Accounting information
- Other variables that affect the entire job such as maximum time and priority
*Executing and Defining
Each program executed by the job is named.
Each file accessed by the program is associated with a physical data set definition:
- Name
- Location (disk, tape, printer)
- Characteristics (size, organization)
*Start with JOB
Each JCL statement has a unique identifier: JOB, EXEC and DD are the most common.
The placement of the JCL statements is important.
A job must start with a JOB statement and...
EXEC and DD
... be followed by its job steps.
Each job step must start with an EXEC and be followed by its DD statements.
The DD statements may be in any order following the EXEC statement.
*Job Steps
Each executed program begins another job step.
And each data set needed in that step must be defined in a DD statement following the EXEC statement.
Topic 1.3: Statement Format
*JCL FormatNow that you have an idea of what JCL is and what it is used for, take a look at its general format.
//name operation operands comments
*Identifying JCL
//
The operating system identifies JCL as JCL (not data or a program) by the // in positions 1 and 2 of the statement.
These positions are the first two character positions starting the line of JCL you're coding.
*What's in a Name?
//name
The name field is in some cases optional, but more frequently is required. The name field is used either:
- To assign a name to a job or a job step or
- As the name the program has associated with a particular file
*The Operation
//name operation
The operation field defines the type of statement. Common statement types include:
// JOB statement to identify a job
// EXEC statements to request a program
// DD statements to define a data set
// statement to end a job (called a null statement)
Several other statement types exist. Some are covered in this course. Others are covered in subsequent courses.
*Operands
//name operation operands
The operands are parameters coded to define the services required by the program. Operands describe, for example:
- Run-time of the program
- Location of the program
- Name of the data set
- Device the data set is located on
*Comments
//name operation operands comments
You may enter any type of comment desired.
JCL must be coded carefully and correctly. The operating system cannot guess what you mean. You must code precisely what you want.
Topic 1.4: JCL vs. Programs
*JCLSo far you have learned that JCL requests a program to be executed and defines the resources the program needs.
It is just another programming language that can be thought of as a control language.
This section explores how JCL differs from a program.
*Programs
First, let's look at what programs are.
A program is a set of instructions in a computer-readable language that controls what a computer does, step by step. Programs are usually written in a high-level language – one with instructions more like readable English.
COBOL, for example, is such a language. These programs are restructured by a compiler to a language format executable by the computer.
*Comparing the Two
Compare that to JCL.
JCL is written as a series of statements that tell a computer what program to execute and what resources will be needed.
The JCL is submitted to the computer just as it was coded. The operating system interprets what was coded for its use.
*Sample Program
In this section you'll walk through these steps for a program that updates a payroll master file.
- Get a record from a transaction file
- Get the associated master file record
- Determine the type of transaction
- Update the master file appropriately
- Print a report
*The Role of JCL
To execute the payroll program, JCL must define the following:
- Job identifier – jobname, accounting info...
- Program to be executed
- Location and characteristics of the payroll master file – tape, disk, volume serial number...
- Location and characteristics of the transaction file
- Selection of a printer for the report – special forms, number of report copies...
*Examining the DifferencesYou'll continue your examination of the differences between a program and JCL by looking at what's involved in running the program to update the payroll master file.
You'll see the roles of the program and the JCL statements in this process. Now let's go on.
Payroll Update Program | JCL Statements |
---|---|
JOB IDENTIFICATION Every job submitted to the computer must carry identification with it – a name, owner and job accounting information. This identification is done on the JOB statement. It must be the first statement in the jobstream. |
Payroll Update Program | JCL Statements |
---|---|
JOB IDENTIFICATION SELECT PROGRAM The next function of a job is to request that a program be fetched and executed. This is done with the EXEC statement, which defines a job step. |
Payroll Update Program | JCL Statements |
---|---|
GET TRANSACTION RECORD GET MASTER RECORD A program requests a record from a data set. |
JOB IDENTIFICATION SELECT PROGRAM TAPE 007659 DISK PAY001 The JCL points to the physical location of the data set. DD statements do this. They must follow the EXEC for the program. They can be listed in any order. |
Payroll Update Program | JCL Statements |
---|---|
GET TRANSACTION RECORD GET MASTER RECORD PERFORM CALCULATIONS The program performs the necessary processing on the data retrieved. |
JOB IDENTIFICATION SELECT PROGRAM TAPE 007659 DISK PAY001 |
Payroll Update Program | JCL Statements |
---|---|
GET TRANSACTION RECORD GET MASTER RECORD PERFORM CALCULATIONS PRINT REPORT The report requested by the program is directed ... |
JOB IDENTIFICATION SELECT PROGRAM TAPE 007659 DISK PAY001 PRINTER / FORM 120 / 5 COPIES ... via the JCL DD statement to the appropriate printer. |
*JCL Is in Control
JCL performs a necessary system requirement.
It allows any number of data sets to be accessed or created by one program.
The program is written with a logical view of what the data looks like. JCL assigns the physical characteristics such as name, location, and size.
This way, the same program can access the data set stored on disk for regular daily processing or stored on a backup tape for a recovery procedure.
Topic 1.5: Unit 1 Summary
In this unit you learned the following:- Job Control Language, called JCL, is the language that you need to do your
work on the computer.
- A job is a unit of work performed by the computer system.
- You refer to a series of JCL statements as a jobstream or input
stream.
- A jobstream is constructed with the job control statements needed to
define your job, your program, and the resources required.
- A job must start with a JOB statement and be followed by its job
steps. Each job step must start with an EXEC and be followed by its
DD statements. The DD statements may be in any order
following the EXEC statement.
- Each program execution within a job is called a job step.
- This is the format of a generic JCL
statement:
//name operation operands comments
- The operation field defines the type of statement. Common statement types
include
// JOB statement to identify a job
// EXEC statements to request a program
// DD statements to define a data set
// statement to end a job (called a null statement)
- A program is a set of instructions in a computer-readable language that
controls what a computer does, step by step. The role of a program includes
getting records, performing calculations, and printing reports.
- JCL is written as a series of statements that tell a computer what program
to execute and what resources will be needed. The role of JCL includes
identifying the job, selecting the program, pointing to the files or storage
devices to read and/or write records, and writing reports.
- JCL performs a necessary system requirement. It allows any number of data sets to be accessed or created by one program.
No comments:
Post a Comment