Jcl Básico Unidad 1

  • Uploaded by: Carlos Alberto Chong Antonio
  • 0
  • 0
  • January 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Jcl Básico Unidad 1 as PDF for free.

More details

  • Words: 5,828
  • Pages: 69
Loading documents preview...
z/OS MVS JCL Introduction

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

z/OS MVS JCL Introduction

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

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

Page 2 of 69

z/OS MVS JCL Introduction

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

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

Page 3 of 69

z/OS MVS JCL Introduction

Course Objectives 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

Introduction

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

Page 4 of 69

z/OS MVS JCL Introduction

UNIT

Introduction to JCL

Topics:  Introduction  JOB Control Statements  JCL Statement Syntax

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

Page 5 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL 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.

Introduction

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

Page 6 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL Unit Objectives 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

Introduction

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

Page 7 of 69

z/OS MVS JCL Introduction

UNIT

Introduction to JCL

Topics:  Introduction  JOB Control Statements  JCL Statement Syntax

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

Page 8 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

Topic Objectives 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

Introduction

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

Page 9 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

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:

Concepts



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

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

Page 10 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

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

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

Page 11 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

Jobs – An Example

After Execution

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

Concepts

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

Page 12 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

JCL Job Information 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

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

Concepts

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

Page 13 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

Job Stream 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.

Concepts

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

Page 14 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

Job Steps 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

Concepts

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

Page 15 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

Are We on Track?

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

Review

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

Page 16 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

Glossary 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. Continued…

Glossary

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

Page 17 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

Glossary (cont’d) 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

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

Page 18 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: Introduction

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

Summary



Define JCL



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



Define the three major JCL statements

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

Page 19 of 69

z/OS MVS JCL Introduction

UNIT

Introduction to JCL

Topics:  Introduction  JOB Control Statements  JCL Statement Syntax

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

Page 20 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Topic Objectives 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

Introduction

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

Page 21 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Defining Job Control Statements 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

Continued… Concepts

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

Page 22 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Defining Job Control Statements (cont’d)

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)

//JOBNUM1 JOB 504,SMITH

//STEP1 EXEC PGM=PROGRAMA •

Data sets to be used (using DD statements)

//DD1 DD DSN=INPUT

Concepts

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

Page 23 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Are We on Track?

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

Review

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

Page 24 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

The JOB Statement 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.

//JOBNUM1 JOB

504,SMITH

//STEP1

EXEC PGM=PROGRAMA

//DD1

DD

DSN=OUTPUT

Continued… Concepts

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

Page 25 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

The JOB Statement (cont’d) 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.

//JOBNUM1 JOB

504,SMITH

//STEP1

EXEC PGM=PROGRAMA

//DD1

DD

//JOBNUM2 JOB

DSN=OUTPUT 600,JONES Parts of a Job

End of Job marker

Concepts

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

Page 26 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

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

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

Page 27 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

The EXEC Statement An EXEC statement often follows the JOB statement. It names a program to be executed. Program Library

Programs are stored in program libraries and retrieved by the operating system when they are referenced by an EXEC statement.

PROGRAMA 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.

INPUT Concepts

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

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

Page 28 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Are We on Track?

Where are programs referenced by an EXEC statement stored? A. Sequential data sets B. Program libraries

C. Tape devices D. Procedure libraries

Review

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

Page 29 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

The DD Statement 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.

Data Sets

Continued… Concepts

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

Page 30 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

The DD Statement (cont’d) The DD statement describes the data set extensively. By using a proper combination of options, DD statements may do the following:

Concepts



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

//JOBNUM1 //STEP1 //DD1 //DD2

JOB EXEC DD DD

504,SMITH PGM=PROGRAMA DSN=OUTPUT DSN=INOUT Data Sets

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

Page 31 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Are We on Track?

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

Review

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

Page 32 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Are We on Track?

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

Review

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

Page 33 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

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

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

Page 34 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Grouping Programs (cont’d) Consider two programs: •

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



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

INOUT 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. OUTPUT1 Concepts

OUTPUT2

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

Page 35 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Grouping Programs: An Example 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

//JOBNUM1 //STEP1 //DD1 // //DD2 // //STEP2 //DD3 // //DD4 // //DD5 //

JOB 504,SMITH EXEC PGM=PROGRAMA DD DSN=INPUT, DISP=SHR DD DSN=INOUT, DISP=(NEW,PASS) EXEC PGM=PROGRAMB DD DSN=INOUT, DISP=(OLD,CATLG) DD DSN=OUTPUT1, DISP=(NEW,CATLG,DELETE) DD DSN=OUTPUT2, DISP=(NEW,CATLG,DELETE)

Continued… Concepts

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

Page 36 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Grouping Programs: An Example (cont’d) 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: • • •

Concepts

INOUT OUTPUT1 OUTPUT2

//JOBNUM1 //STEP1 //DD1 // //DD2 // //STEP2 //DD3 // //DD4 // //DD5 //

JOB 504,SMITH EXEC PGM=PROGRAMA DD DSN=INPUT, DISP=SHR DD DSN=INOUT, DISP=(NEW,PASS) EXEC PGM=PROGRAMB DD DSN=INOUT, DISP=(OLD,CATLG) DD DSN=OUTPUT1, DISP=(NEW,CATLG,DELETE) DD DSN=OUTPUT2, DISP=(NEW,CATLG,DELETE)

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

Page 37 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Other JCL Statements Besides the JOB, EXEC and DD statements, there are some less frequently used JCL statements. These include: •



Concepts

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.

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

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.

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

Page 38 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Are We on Track?

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

Review

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

Page 39 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Are We on Track?

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

Review

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

Page 40 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

Glossary 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

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

Page 41 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JOB Control Statements

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

Summary



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

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

Page 42 of 69

z/OS MVS JCL Introduction

UNIT

Introduction to JCL

Topics:  Introduction  JOB Control Statements  JCL Statement Syntax

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

Page 43 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Topic Objectives 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

Introduction

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

Page 44 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

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

Concepts



The identifier field



The name field



The operation field



The parameter field



The comment field

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

Page 45 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

The Identifier Field Identifier

Name

Operation

Parameter

Comment

Field

Field

Field

Field

Field

// JOBNUM1

JOB

501,SMITH

COMMENT

1 2 3

71

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. Concepts

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

Page 46 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

The Name Field Identifier

Name

Operation

Parameter

Comment

Field

Field

Field

Field

Field

// JOBNUM1

JOB

501,SMITH

COMMENT

1 2 3

71

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.

Concepts

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

Page 47 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Rules for Naming JCL Statements The specifications for JCL statement names are as follows:

Concepts



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

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

Name Field

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

Page 48 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Are We on Track?

Match each JCL field types with their main function

Review

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

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

Page 49 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Are We on Track?

Which of the following is a valid JOB name? A. //TEST*1 B. // JOB13 C. //$ABCD D. //STEPSEVEN

Review

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

Page 50 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

The Operation Field Identifier

Name

Operation

Parameter

Comment

Field

Field

Field

Field

Field

// JOBNUM1

JOB

501,SMITH

COMMENT

1 2 3

71

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.

Concepts

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

Page 51 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Operation Fields: An example In the JCL statements that you have seen so far, the operation fields contain the operators JOB, EXEC, and DD.

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

Following are examples of three JCL statement types with different operators:

Concepts



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 Field

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

Page 52 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

The Parameter Field Identifier

Name

Operation

Parameter

Comment

Field

Field

Field

Field

Field

// JOBNAME

JOB

501,SMITH

COMMENT

1 2 3

71

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: • • • •

Concepts

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

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

Page 53 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Parameter Fields: An Example The JOB statement here contains parameters specifying the following: • • •

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

//JOB1 JOB // //STEP1 EXEC // //DD1 DD

504,SMITH, MSGLEVEL=(1,0) PGM=PROGRAM1, TIME=4 DSN=INPUT,DISP=SHR

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)

Parameter Field

The DD statement here has two parameters: • •

Concepts

The first one specifies the data set name TRANS1 The second one specifies a status of OLD. © Copyright IBM Corp., 2000, 2004. All rights reserved.

Page 54 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Are We on Track?

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

Review

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

Page 55 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Are We on Track?

Match the following parameters with their descriptions:

Review

1. SMITH

A. Maximum run time for the program

2. TIME=4

B. Data set name

3. DSN=TRANS1

C. Programmer's name

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

Page 56 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

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:

Concepts



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.

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

Page 57 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Procedure for Continuing a JCL Statement

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

Line to be interrupted

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.

Continued… Concepts

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

Page 58 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Procedure for Continuing a JCL Statement (cont’d)

//STEPNAME EXEC PGM=A,TIME=1,PARM=LIST // Code // in positions 1 and 2 of the following statement 2. Code // in positions 1 and 2 of the following statement.

Continued… Concepts

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

Page 59 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Procedure for Continuing a JCL Statement (cont’d)

//STEPNAME EXEC PGM=A, //

TIME=1,

//

PARM=LIST

Continued parameters

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

Concepts

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

Page 60 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Continuation statement: An Example Following is an example of a single JCL statement that continues on 2 additional lines. All 3 lines comprise one JCL statement.

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

In this example, note the following:

Concepts



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

Blank position

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

Page 61 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

The Comment Field Identifier

Name

Operation

Parameter

Comment

Field

Field

Field

Field

Field

// JOBNUM1

JOB

501,SMITH

COMMENT

1 2 3

71

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.

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

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

Page 62 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Comment Field: An Example The following example shows a JCL statement that contains a comment - 'INVENTORY JOB'. A blank separates the parameter field from the words INVENTORY JOB.

Concepts

//JOB1 JOB 504,KAY INVENTORY JOB

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

Page 63 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Are We on Track?

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

Review

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

Page 64 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Rules for Writing JCL Statements You should remember the following rules while writing a JCL statement:

Concepts



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.

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

Page 65 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Glossary 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

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

Page 66 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

Glossary (cont’d) 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

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

Page 67 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL

Topic: JCL Statement Syntax

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

Summary



Define the nature and function of each field



Code each field using the correct procedure

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

Page 68 of 69

z/OS MVS JCL Introduction Unit: Introduction to JCL Unit Summary Now that you have completed this unit, you should be able to:

Summary



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

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

Page 69 of 69

Related Documents

Jcl Intermedio Unidad 1
January 2021 1
Jcl Basico Unidad 2
January 2021 1
Jcl Basico Unidad 6
January 2021 4
Jcl Intermedio Unidad 2
January 2021 1

More Documents from "Carlos Alberto Chong Antonio"

Z/os Mvs Jcl Introduction
January 2021 0
Jcl Basico Unidad 2
January 2021 1
January 2021 0
January 2021 0
January 2021 0