jcl básico unidad 1

69
z/OS MVS JCL Introduction © Copyright IBM Corp., 2000, 2004. All rights reserved.

Upload: carlos-alberto-chong-antonio

Post on 28-Apr-2015

53 views

Category:

Documents


8 download

DESCRIPTION

Presentancion de IBM sobre introduccón a jcl JCL basico unidad 1.

TRANSCRIPT

Page 1: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved.

Page 2: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 2 of 69

Course Details

Audience

This course is designed as an introductory JCL programming course for system programmers, operators and

application programmers.

Prerequisites

This course assumes the student has basic knowledge of IS technologies, data processing, software and

hardware from the OS/390 Introduction and OS/390 MVS Concepts and Facilities courses. It is suggested that

the student first complete the OS/390 Introduction (38051) course.

Introduction

Page 3: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 3 of 69

Course Introduction

Welcome to z/OS MVS JCL Introduction, this course provides detailed information about JOB Control

Language and the correct procedures for coding JCL statements to perform data processing jobs in an MVS

environment.

The first unit is Introduction to JCL. This unit provides an overview Job Control Language (JCL), including

the three main types of JCL statements and explains how to group JCL codes into job streams.

The second, third and fourth units are Coding JOB Statements, Coding EXEC Statements, and Coding DD

statements respectively. These units provide details for coding JOB, EXEC and DD statements.

The fifth unit is Analyzing Job Output and it explains how you can read the processed results of a job as

well as how to identify error messages in a printed output.

The final unit is Conditional Processing. This unit will describe how to execute job steps based on

IF/THEN/ELSE/ENDIF statements. It will also explain how conditional processing adds conditions to a base

program and diversifies it in order to minimize programming time.

Introduction

Page 4: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 4 of 69

At the end of this course, you will be able to:

• Identify JCL statements and their purpose

• Code a JOB statement, including most commonly used parameters

• Code an EXEC statement to invoke a program, including PARM, TIME and COND parameters

• Code a DD statement to identify a data set, including the DDNAME and the DSN parameter

• Code the library DD statements JOBLIB and STEPLIB

• Identify the JCL statement errors in an output listing and code appropriate corrections

• Code the IF/THEN/ELSE/ENDIF JCL statement construct

Course Objectives

Introduction

Page 5: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 5 of 69

UNIT Introduction to JCL

Introduction

JOB Control Statements

JCL Statement Syntax

Topics:

Page 6: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 6 of 69

Unit Introduction

Job Control Language (JCL) consists of a series of statements, each of which provides specific instructions or

information for processing various jobs.

This unit describes the purpose, function, sequence, and syntax of the JOB, EXEC, and DD statements.

Apart from this it will also describe the use of the optional comment and null statements and the correct

syntax for coding these statements.

Unit: Introduction to JCL

Introduction

Page 7: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 7 of 69

At the end of this unit, you will be able to:

• Identify the three major JCL statements and the purpose of each

• Arrange JCL statements for a specific sequence of execution

• Select three major considerations for grouping work into jobs

• Place JCL statement fields into the correct format

• Identify properly coded JCL statements

Unit Objectives

Unit: Introduction to JCL

Introduction

Page 8: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 8 of 69

UNIT Introduction to JCL

Introduction

JOB Control Statements

JCL Statement Syntax

Topics:

Page 9: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 9 of 69

At the end of this topic, you will be able to:

• Define JCL

• Describe the purpose of JCL in a Multiple Virtual Storage (MVS) system

• Define the three major JCL statements

Topic Objectives

Introduction

Unit: Introduction to JCL Topic: Introduction

Page 10: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 10 of 69

Job Control Language

What is JCL?

Job Control Language (JCL) is a control language used to identify a job to an operating system and to

describe the job’s requirements. It consists of a series of statements, each of which provides specific

instructions or information for batch processing jobs.

JCL is used to describe the work you want a system using multiple virtual storage (MVS) to perform.

The three main types of JCL statements are:

• JOB - It marks the beginning of a job and identifies the job name

• EXEC - It marks the beginning of a job step and specifies the name of the program to be executed

• DD - It describes data sets to be used within individual steps

Unit: Introduction to JCL Topic: Introduction

Concepts

Page 11: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 11 of 69

Job Control Language

What is a job?

A job is a unit of work defined by a user to be accomplished by a computer, including computer programs, files

or control statements.

For example: The request to perform a task of updating one data set with information from another data set is

called a job.

JCL provides the operating system with information about the resources, programs, and data necessary to

complete the job.

Concepts

Unit: Introduction to JCL Topic: Introduction

Page 12: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 12 of 69

Jobs – An Example

Example: A job may direct the computer to run a program that combines two data sets into one new data set.

1 00 1 1 0

0 1

1 00 1

After Execution

Concepts

Unit: Introduction to JCL Topic: Introduction

Page 13: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 13 of 69

JCL provides information to the system about

job details including:

• The programs to execute

• The location of the required data sets

• The department to be billed for CPU processing time

• The job class

JCL Job Information

//JOB1 JOB 504,SMITH//JOB1 JOB CLASS=A

Concepts

Unit: Introduction to JCL Topic: Introduction

Page 14: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 14 of 69

One or more jobs placed in a series and ready to

be submitted to the system are referred to as a

job stream.

This series of jobs is entered through one input

device. You can use JCL to structure a job

stream.

The JCL for each job begins with a JOB

Statement.

Job Stream

Concepts

Unit: Introduction to JCL Topic: Introduction

Page 15: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 15 of 69

A job consists of one or more individual job steps.

Each job step starts with an EXEC statement and

is associated with the execution of one program.

The data sets required for each job step can be

defined using a DD statement.

You then submit each job for processing as part

of the job stream

Job Steps

Concepts

Unit: Introduction to JCL Topic: Introduction

Page 16: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 16 of 69

The JCL specifying a collection of jobs to be run is called a(n) __________

Are We on Track?

Review

Unit: Introduction to JCL Topic: Introduction

Page 17: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 17 of 69

Batch – A group of records or data processing jobs brought together for processing or transmission.

Central Processing Unit (CPU) – The CPU controls the operation of a computer. Units within the CPU perform arithmetic and logical operations and decode and execute instructions.

Data set – Synonym for file. A unit of information that can be stored and retrieved.

DD statement – A job control statement describing a data set associated with a specific job set.

EXEC statement – Marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in

this step.

Job – A unit of work defined by a user to be accomplished by a computer, including computer programs, files or control statements.

Glossary

Continued…

Glossary

Unit: Introduction to JCL Topic: Introduction

Page 18: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 18 of 69

Job Control Language (JCL) – A control language used to identify a job to an operating system and to describe the job’s requirements.

Job steps – The job control statement that requests and controls the execution of a program and requests the resources needed to run the program. A job step is identified by an EXEC statement.

Job stream – Jobs placed in a series and entered through one input device.

Multiple Virtual Storage (MVS) –The standard operating system for older large IBM mainframes. Implies OS/390, MVS/XA. and MVS/ESA.

Operating system – Software that controls the execution of programs and provides I/O control and data management services.

Glossary (cont’d)

Glossary

Unit: Introduction to JCL Topic: Introduction

Page 19: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 19 of 69

Now that you have completed this topic, you should be able to:

• Define JCL

• Describe the purpose and scope of JCL in a Multiple Virtual Storage (MVS) system

• Define the three major JCL statements

Topic Summary

Summary

Unit: Introduction to JCL Topic: Introduction

Page 20: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 20 of 69

UNIT Introduction to JCL

Introduction

JOB Control Statements

JCL Statement Syntax

Topics:

Page 21: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 21 of 69

At the end of this topic, you will be able to:

• Describe the scope of JCL statements

• Describe the nature and function of a JOB statement, an EXEC statement and a DD statement

• Identify the considerations determining the grouping of programs together as a job

• Describe the nature and functions of a comment statement and a null statement

Topic Objectives

Introduction

Unit: Introduction to JCL Topic: JOB Control Statements

Page 22: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 22 of 69

Job control statements define jobs and job steps.

Job control statements are JCL statements

created to provide the following information:

• Programs to be executed

• Sequence of program execution

• Data sets required by the programs

Defining Job Control Statements

Continued…

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 23: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 23 of 69

What details do you have to specify for each

job?

Each job requires you to specify at least the

following:

• Job to begin (using a JOB statement)

• Program(s) to be executed (using EXEC statements)

• Data sets to be used (using DD statements)

Defining Job Control Statements (cont’d)

//JOBNUM1 JOB 504,SMITH

//STEP1 EXEC PGM=PROGRAMA

//DD1 DD DSN=INPUT

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 24: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 24 of 69

You would use the _______ statement to run a program as part of a job.

Are We on Track?

Review

Unit: Introduction to JCL Topic: JOB Control Statements

Page 25: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 25 of 69

The JOB statement is the first control statement in

a job. It marks the beginning of a job and specifies

the job name.

The JOB statement may also provide details and

parameters that relate to the overall job, such as

accounting information and conditions for job

termination.

The JOB Statement

Continued…

//JOBNUM1 JOB 504,SMITH

//STEP1 EXEC PGM=PROGRAMA

//DD1 DD DSN=OUTPUT

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 26: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 26 of 69

Each job must begin with a JOB statement. All

statements that follow up to the next JOB

statement, are parts of one job.

The end of a job is marked by either another JOB

statement or by a null statement.

The JOB Statement (cont’d)

//JOBNUM2 JOB 600,JONES

Parts of a Job

End of Job marker

//JOBNUM1 JOB 504,SMITH

//STEP1 EXEC PGM=PROGRAMA

//DD1 DD DSN=OUTPUT

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 27: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 27 of 69

Are We on Track?

Which of the following is a function of the JOB statement?

A. Contains documentation information only

B. Identifies the program to be run

C. Identifies the data sets to be used during the job

D. Identifies the job name and specifies accounting information

Review

Unit: Introduction to JCL Topic: JOB Control Statements

Page 28: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 28 of 69

An EXEC statement often follows the JOB

statement. It names a program to be executed.

Programs are stored in program libraries and

retrieved by the operating system when they are

referenced by an EXEC statement.

A job contains one or more EXEC statements,

each followed by statements that define one or

more data sets needed for that job step.

A job step ends with the next EXEC statement,

the JOB statement for the next job, or a null

statement.

The EXEC Statement

Program Library

//JOBNUM1 JOB 504,SMITH//STEP1 EXEC PGM=PROGRAMA//DD1 DD DSN=INPUT

PROGRAMA

INPUT

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 29: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 29 of 69

Where are programs referenced by an EXEC statement stored?

A. Sequential data sets

B. Program libraries

C. Tape devices

D. Procedure libraries

Are We on Track?

Review

Unit: Introduction to JCL Topic: JOB Control Statements

Page 30: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 30 of 69

DD statements define the data sets the program

uses during execution. Each data set used in the

job requires at least one DD statement.

The number of DD statements following an EXEC

statement depends on the number of data sets

required by a program. The order of DD

statements within a job step is not usually

significant.

The DD Statement

Continued…

Data Sets

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 31: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 31 of 69

The DD statement describes the data set

extensively. By using a proper combination of

options, DD statements may do the following:

• Give the data set name

• Specify the initial status and final disposition of the data set

• Specify volumes

• Specify record length, format, and blocking

• Request I/O devices

• Specify storage allocation for new data sets

The DD Statement (cont’d)

//JOBNUM1 JOB 504,SMITH//STEP1 EXEC PGM=PROGRAMA//DD1 DD DSN=OUTPUT//DD2 DD DSN=INOUT

Data Sets

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 32: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 32 of 69

The data set requirements for a program are described to the operating system by the

__________ statements.

Are We on Track?

Review

Unit: Introduction to JCL Topic: JOB Control Statements

Page 33: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 33 of 69

Which of the following functions can DD statements perform?

A. Tell the system which data set to access

B. Request a printer to produce the job output

C. Initiate a new program

D. Indicate where to store new data sets

Are We on Track?

Review

Unit: Introduction to JCL Topic: JOB Control Statements

Page 34: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 34 of 69

Grouping Programs

When deciding which programs to group together as a single job, you may consider programs that:

• Have to run sequentially

• Have the same job accounting information

• Are dependent on each other

Continued…

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 35: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 35 of 69

Consider two programs:

• Program A takes input from the INPUT data set and uses it to create the INOUT data set.

• Program B uses the data set created by Program A as its input and creates two more data sets called OUTPUT1 and OUTPUT2.

Can you group Program A and Program B?

Since these programs must run sequentially and

Program B is dependent on Program A, they can

be grouped into a single job.

Grouping Programs (cont’d)

INPUT

INOUT 1 0

0 1

1 00 1

1 00 1

OUTPUT1 OUTPUT2

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 36: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 36 of 69

The JCL for the preceding example is shown on

the right.

In the example, an EXEC statement

marks the beginning of the first job step (STEP1)

and invokes a program called PROGRAMA.

Because PROGRAMA uses one data set to

create another, two data definition statements are

needed. One for each of the following:

• INPUT

• INOUT

Grouping Programs: An Example

Continued…

//JOBNUM1 JOB 504,SMITH//STEP1 EXEC PGM=PROGRAMA//DD1 DD DSN=INPUT,// DISP=SHR//DD2 DD DSN=INOUT,// DISP=(NEW,PASS)//STEP2 EXEC PGM=PROGRAMB//DD3 DD DSN=INOUT,// DISP=(OLD,CATLG)//DD4 DD DSN=OUTPUT1, // DISP=(NEW,CATLG,DELETE)//DD5 DD DSN=OUTPUT2,// DISP=(NEW,CATLG,DELETE)

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 37: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 37 of 69

When the system invokes PROGRAMB, another

step begins in the job, which is STEP2.

Because PROGRAMB uses the output of

PROGRAMA as input and then creates two output

data sets of its own, PROGRAMB needs three

data definition statements, one for each of the

following:

• INOUT

• OUTPUT1

• OUTPUT2

Grouping Programs: An Example (cont’d)

//JOBNUM1 JOB 504,SMITH//STEP1 EXEC PGM=PROGRAMA//DD1 DD DSN=INPUT,// DISP=SHR//DD2 DD DSN=INOUT,// DISP=(NEW,PASS)//STEP2 EXEC PGM=PROGRAMB//DD3 DD DSN=INOUT,// DISP=(OLD,CATLG)//DD4 DD DSN=OUTPUT1, // DISP=(NEW,CATLG,DELETE)//DD5 DD DSN=OUTPUT2,// DISP=(NEW,CATLG,DELETE)

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 38: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 38 of 69

Besides the JOB, EXEC and DD statements,

there are some less frequently used JCL

statements. These include:

• Comment statements: You can use these to document JCL statements. A comment statement is coded with two forward slashes and an asterisk (//*) in the first 3 positions. The comment text is coded in positions 4 through 71.

• Null statements: You can use a null statement to mark the end of a job. It is coded with two forward slashes (//) in positions 1 and 2 and no other characteristics.

Other JCL Statements

Comment statement

Null statement

//JOBNUM1 JOB 504,SMITH//* COMMENTS CAN GO HERE//STEP1 EXEC PGM=PROGRAM1//DD1 DD DSN=TRANS1,// DISP=OLD//

Concepts

Unit: Introduction to JCL Topic: JOB Control Statements

Page 39: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 39 of 69

Which of the following are considerations for determining which programs should be grouped together as a job?

A. Programs must run sequentially

B. Programs must be dependent on each other

C. Programs must access the same databases

D. Programs must have the same accounting information

Are We on Track?

Review

Unit: Introduction to JCL Topic: JOB Control Statements

Page 40: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 40 of 69

During the course of a job, a program uses the output from a previous job step as its source data, and then creates a new data set and copies it to another storage device. How many DD statements would you find in the JCL for this job step?

A. Two

B. One

C. Three

D. Four

Are We on Track?

Review

Unit: Introduction to JCL Topic: JOB Control Statements

Page 41: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 41 of 69

Comment statements – The comment statement is used primarily to document a program and its resource requirements.

Input/Output (I/O) – Transfer of data into a computer and from the computer to the outside world.

Null – A blank statement beginning with a double slash (//) that marks the end of a job.

Glossary

Glossary

Unit: Introduction to JCL Topic: JOB Control Statements

Page 42: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 42 of 69

Now that you have completed this topic, you should be able to:

• Describe the scope of JCL statements

• Describe the nature and function of a JOB statement, an EXEC statement and a DD statement

• Identify the considerations determining the grouping of programs together as a job

• Describe the nature and functions of a comment statement and a null statement

Topic Summary

Summary

Unit: Introduction to JCL Topic: JOB Control Statements

Page 43: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 43 of 69

UNIT Introduction to JCL

Introduction

JOB Control Statements

JCL Statement Syntax

Topics:

Page 44: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 44 of 69

At the end of this topic, you will be able to:

• Define the nature and function of each field

• Code each field using the correct procedure

Topic Objectives

Introduction

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 45: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 45 of 69

JCL Statement Fields

Most JCL statements have the same format consisting of five fields, which are as follows:

• The identifier field

• The name field

• The operation field

• The parameter field

• The comment field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 46: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 46 of 69

The Identifier Field

The identifier field occupies positions 1 and 2. It usually contains two forward slashes (//) and indicates that

the statement is a JCL statement (as opposed to a data record).

The remaining four fields must be coded from position 3 through position 71.

Always code the JCL statement field in the order shown here.

// JOBNUM1 JOB 501,SMITH COMMENT

Identifier

Field

Name

Field

Operation

Field

Parameter

Field

Comment

Field

1 2 3 71

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 47: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 47 of 69

The name field must begin in position 3 with no spaces between the identifier and the name fields.

The name field identifies the JCL statement by name so that other JCL statements or the operating system

can refer to it.

A name is optional for some EXEC statements, but is required on JOB and almost all DD statements.

The Name Field

// JOBNUM1 JOB 501,SMITH COMMENT

1 2 3 71

Identifier

Field

Name

Field

Operation

Field

Parameter

Field

Comment

Field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 48: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 48 of 69

The specifications for JCL statement names are as follows:

• The name must begin in position 3

• The name can be one to eight characters in length

• The first character in the name must be alphabetic character (A to Z) or national character (#, @, $).

• The first character cannot be numeric (0 through 9)

• The remaining characters can be alpha numeric (A to Z and 0 through 9) or national characters

• No special characters or spaces can be included in a name

Rules for Naming JCL Statements

//JOB1 JOB 504,SMITH//STEP1 EXEC PGM=PROGRAMA//DD1 DD DSN=INPUT,DISP=SHR

Name Field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 49: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 49 of 69

Match each JCL field types with their main function

1. Parameter A. Contains documentation information from the JCL coder

2. Comments B. Specifies the type of statement

3. Operation C. Contains specific statement values

4. Name D. Identifies a JCL statement

Are We on Track?

Review

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 50: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 50 of 69

Which of the following is a valid JOB name?

A. //TEST*1

B. // JOB13

C. //$ABCD

D. //STEPSEVEN

Are We on Track?

Review

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 51: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 51 of 69

The operation field defines the JCL statement type - JOB, EXEC, or DD.

For every JCL statement, the operation field must follow the name field and it must be preceded by at least

one blank space.

The Operation Field

// JOBNUM1 JOB 501,SMITH COMMENT

1 2 3 71

Identifier

Field

Name

Field

Operation

Field

Parameter

Field

Comment

Field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 52: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 52 of 69

In the JCL statements that you have seen so far,

the operation fields contain the operators JOB,

EXEC, and DD.

Following are examples of three JCL statement

types with different operators:

• The first JCL statement has the operator JOB in the operation field

• The second JCL statement contains the operator EXEC

• The third statement contains the operator DD

Operation Fields: An example

//JOB1 JOB 504,SMITH//STEP1 EXEC PGM=PROGRAMA//DD1 DD DSN=INPUT,DISP=SHR

Operation Field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 53: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 53 of 69

The parameter field contains one or more parameters separated by commas. Each JOB, EXEC and DD

statement has its own set of parameter information.

The parameter field of each JCL statement must:

• Follow the operation field

• Include one or more blanks between it and the operation field

• Use commas to separate parameters

• Have no blanks between parameters

The Parameter Field

// JOBNAME JOB 501,SMITH COMMENT

1 2 3 71

Identifier

Field

Name

Field

Operation

Field

Parameter

Field

Comment

Field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 54: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 54 of 69

The JOB statement here contains parameters specifying the following:

• Accounting information (504) • The JCL programmer's name (SMITH) • MSGLEVEL (message level) parameter

The EXEC statement here contains two parameters:

• The first one specifies the program name (PROGRAM1)

• The second one specifies the maximum CPU time for the program (4 minutes)

The DD statement here has two parameters:

• The first one specifies the data set name TRANS1

• The second one specifies a status of OLD.

Parameter Fields: An Example

//JOB1 JOB 504,SMITH,// MSGLEVEL=(1,0)//STEP1 EXEC PGM=PROGRAM1,// TIME=4//DD1 DD DSN=INPUT,DISP=SHR

Parameter Field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 55: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 55 of 69

Place the following fields in the order in which they appear in a JCL statement (from first to last).

A. Name

B. Comment

C. Operation

D. Parameter

E. Identifier

Are We on Track?

Review

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 56: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 56 of 69

Match the following parameters with their descriptions:

1. SMITH A. Maximum run time for the program

2. TIME=4 B. Data set name

3. DSN=TRANS1 C. Programmer's name

Are We on Track?

Review

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 57: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 57 of 69

Continuation Statement

You can continue a JCL statement on one or more separate lines.

When can a JCL statement be continued on more than one line?

A JCL statement may be continued on more than one line if:

• The JCL statement requires more than 71 positions to specify all the necessary parameters.

• You want to make it easier to read all the parameters. For example: You could code one parameter per line.

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 58: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 58 of 69

The procedure for coding a JCL statement on more than one line is as follows:

1. Interrupt the coding of a field after a complete parameter or subparameter, including the comma that follows

it, before reaching position 72.

Procedure for Continuing a JCL Statement

Continued…

//STEPNAME EXEC PGM=A,TIME=1,PARM=LIST

Line to be interrupted

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 59: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 59 of 69

2. Code // in positions 1 and 2 of the following statement.

Procedure for Continuing a JCL Statement (cont’d)

Continued…

//STEPNAME EXEC PGM=A,TIME=1,PARM=LIST

//

Code // in positions 1 and 2 of the following statement

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 60: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 60 of 69

3. Continue the parameters of the interrupted field, beginning in any position from 4 to 16.

Procedure for Continuing a JCL Statement (cont’d)

//STEPNAME EXEC PGM=A,

// TIME=1,

// PARM=LISTContinued parameters

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 61: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 61 of 69

Following is an example of a single JCL statement

that continues on 2 additional lines. All 3 lines

comprise one JCL statement.

In this example, note the following:

• The second and the third lines each have a blank in position 3, after the identifier field (//)

• The blank in position 3 of the second line, following the ending comma on the first line, indicates that the second line is a continuation of the first line

• The blank in position 3 of the third line, following the ending comma on the second line, indicates that the third line is a continuation of the second line

Continuation statement: An Example

//STEP1 EXEC PGM=PROGRAMA,// TIME=1,// PARM=LIST

Blank position

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 62: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 62 of 69

A comment field contains extra documentation which you may choose to include. It contains documentation

relating to the code or other messages from the programmer.

A comment field must follow the parameter field and must be preceded by one or more blanks.

The Comment Field

It is a good programming practice to put comments in your JCL statements wherever possible.

// JOBNUM1 JOB 501,SMITH COMMENT

1 2 3 71

Identifier

Field

Name

Field

Operation

Field

Parameter

Field

Comment

Field

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 63: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 63 of 69

The following example shows a JCL statement

that contains a comment - 'INVENTORY JOB'. A

blank separates the parameter field from the

words INVENTORY JOB.

Comment Field: An Example

//JOB1 JOB 504,KAY INVENTORY JOB

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 64: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 64 of 69

Place the following JCL statements in the correct order.

A. //STEP1 EXEC PGM=PROG1

B. //PAY JOB 03948,FRASER=(1,0)

C. //XYZ DD DSN

Are We on Track?

Review

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 65: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 65 of 69

Rules for Writing JCL Statements

You should remember the following rules while writing a JCL statement:

• The identifying characters (//) must be in positions 1 and 2.

• The name field must begin in position 3.

• Each subsequent field must be preceded by one or more spaces.

• A continuation line begins with //.

• Continuing parameters must start in positions 4 through 16.

• Do not embed blanks within any field. For example, do not code a blank to separate parameters in the parameter field.

• Do not code past position 71.

Concepts

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 66: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 66 of 69

Alphabetic Characters – Capital A to capital Z.

Comment Field – The comment field contains documentation relating to the code or other messages from the programmer.

Identifier Field – The identifier field indicates to the system that a JCL statement rather than data.

Name Field – The name field identifies a particular statement so that other statements and the system can refer to it.

National Characters – The national characters are the at sign [@], the dollar sign [$], or the pound sign [#].

Numeric Characters – Numbers 0 through 9.

Operation Field – The operation field specifies the type of statement, or, for the command statement, the command.

Parameter Field – The parameter field contains statement parameters separated by commas.

Glossary

Glossary

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 67: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 67 of 69

Special Characters – These include ampersand [&]; exclamation mark [!]; asterisk [*]; comma [,]; equal sign [=]; hyphen [-]; period [.]; plus sign [+]; slash [/]; left parenthesis [(]; right

parenthesis [)]

Subparameter – Parameters and variables contained within positional and keyword parameters that

further qualify or define the settings or actions coded in a statement.

Glossary (cont’d)

Glossary

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 68: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 68 of 69

Now that you have completed this topic, you should be able to:

• Define the nature and function of each field

• Code each field using the correct procedure

Topic Summary

Summary

Unit: Introduction to JCL Topic: JCL Statement Syntax

Page 69: JCL básico unidad 1

z/OS MVS JCL Introduction

© Copyright IBM Corp., 2000, 2004. All rights reserved. Page 69 of 69

Now that you have completed this unit, you should be able to:

• Identify the three major JCL statements and the purpose of each

• Arrange JCL statements for a specific sequence of execution

• Select three major considerations for grouping work into jobs

• Arrange JCL statement field into the correct format

• Identify properly coded JCL statements

Unit Summary

Summary

Unit: Introduction to JCL