You are on page 1of 69

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

. 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. you will be able to: ‡ ‡ Identify JCL statements and their purpose Code a JOB statement. All rights reserved. 2004. including PARM. Page 4 of 69 . including most commonly used parameters Code an EXEC statement to invoke a program. TIME and COND parameters Code a DD statement to identify a data set.z/OS MVS JCL Introduction Course Objectives At the end of this course. 2000.

Page 5 of 69 .. 2004. All rights reserved.z/OS MVS JCL Introduction UNIT Introduction to JCL Topics:  Introduction  JOB Control Statements  JCL Statement Syntax © Copyright IBM Corp. 2000.

EXEC. function. and syntax of the JOB. This unit describes the purpose. sequence.z/OS MVS JCL Introduction Unit: Introduction to JCL Unit Introduction Job Control Language (JCL) consists of a series of statements. 2004. each of which provides specific instructions or information for processing various jobs. 2000. and DD statements. All rights reserved.. Introduction © Copyright IBM Corp. Apart from this it will also describe the use of the optional comment and null statements and the correct syntax for coding these statements. Page 6 of 69 .

2004. All rights reserved.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. Page 7 of 69 . 2000.

Page 8 of 69 . 2000..z/OS MVS JCL Introduction UNIT Introduction to JCL Topics:  Introduction  JOB Control Statements  JCL Statement Syntax © Copyright IBM Corp. 2004. All rights reserved.

. Page 9 of 69 . 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: Introduction ‡ Introduction © Copyright IBM Corp. 2004.z/OS MVS JCL Introduction Unit: Introduction to JCL Topic Objectives At the end of this topic. All rights reserved. 2000.

It marks the beginning of a job and identifies the job name EXEC . Page 10 of 69 . 2000. 2004. All rights reserved..It describes data sets to be used within individual steps Topic: Introduction Concepts © Copyright IBM Corp. each of which provides specific instructions or information for batch processing jobs. It consists of a series of statements.z/OS MVS JCL Introduction Unit: Introduction to JCL 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. The three main types of JCL statements are: ‡ ‡ ‡ JOB . JCL is used to describe the work you want a system using multiple virtual storage (MVS) to perform.It marks the beginning of a job step and specifies the name of the program to be executed DD .

All rights reserved. including computer programs. 2004.z/OS MVS JCL Introduction Unit: Introduction to JCL Job Control Language What is a job? A job is a unit of work defined by a user to be accomplished by a computer.. 2000. programs. JCL provides the operating system with information about the resources. and data necessary to complete the job. Page 11 of 69 . For example: The request to perform a task of updating one data set with information from another data set is called a job. Topic: Introduction Concepts © Copyright IBM Corp. files or control statements.

2004..z/OS MVS JCL Introduction Unit: Introduction to JCL Jobs ± An Example Topic: Introduction After Execution Example: A job may direct the computer to run a program that combines two data sets into one new data set. Page 12 of 69 . 2000. Concepts © Copyright IBM Corp. All rights reserved.

All rights reserved.z/OS MVS JCL Introduction Unit: Introduction to JCL 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 Topic: Introduction ‡ //JOB1 JOB 504.SMITH //JOB1 JOB CLASS=A Concepts © Copyright IBM Corp. 2004. 2000.. Page 13 of 69 .

z/OS MVS JCL Introduction Unit: Introduction to JCL 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. Topic: Introduction Concepts © Copyright IBM Corp. The JCL for each job begins with a JOB Statement. This series of jobs is entered through one input device. Page 14 of 69 . 2004. You can use JCL to structure a job stream.. 2000. All rights reserved.

All rights reserved. Each job step starts with an EXEC statement and is associated with the execution of one program.z/OS MVS JCL Introduction Unit: Introduction to JCL Job Steps A job consists of one or more individual job steps. Page 15 of 69 . 2004. You then submit each job for processing as part of the job stream Topic: Introduction Concepts © Copyright IBM Corp.. The data sets required for each job step can be defined using a DD statement. 2000.

All rights reserved..z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: Introduction The JCL specifying a collection of jobs to be run is called a(n) __________ Review © Copyright IBM Corp. 2000. 2004. Page 16 of 69 .

Continued« Glossary © Copyright IBM Corp. assigns a name to the step.. including computer programs. ± Marks the beginning of a job step. 2000. ± A job control statement describing a data set associated with a specific job set. 2004. Topic: Introduction Central Processing Unit (CPU) Data set DD statement EXEC statement Job Page 17 of 69 . ± The CPU controls the operation of a computer. Units within the CPU perform arithmetic and logical operations and decode and execute instructions. A unit of information that can be stored and retrieved.z/OS MVS JCL Introduction Unit: Introduction to JCL Glossary Batch ± A group of records or data processing jobs brought together for processing or transmission. ± Synonym for file. ± A unit of work defined by a user to be accomplished by a computer. identifies the program or catalogued or in-stream procedure to be executed in this step. files or control statements. All rights reserved.

Page 18 of 69 . 2004. ±The standard operating system for older large IBM mainframes. 2000. ± Software that controls the execution of programs and provides I/O control and data management services. ± The job control statement that requests and controls the execution of a program and requests the resources needed to run the program. ± Jobs placed in a series and entered through one input device.. Topic: Introduction Job steps Job stream Multiple Virtual Storage (MVS) Operating system Glossary © Copyright IBM Corp. MVS/XA.z/OS MVS JCL Introduction Unit: Introduction to JCL 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. and MVS/ESA. Implies OS/390. All rights reserved. A job step is identified by an EXEC statement.

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: Introduction ‡ Summary © Copyright IBM Corp. Page 19 of 69 ..z/OS MVS JCL Introduction Unit: Introduction to JCL Topic Summary Now that you have completed this topic. All rights reserved. 2004. 2000.

2000.. Page 20 of 69 .z/OS MVS JCL Introduction UNIT Introduction to JCL Topics:  Introduction  JOB Control Statements  JCL Statement Syntax © Copyright IBM Corp. All rights reserved. 2004.

z/OS MVS JCL Introduction Unit: Introduction to JCL Topic Objectives At the end of this topic. All rights reserved. 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: JOB Control Statements ‡ ‡ Introduction © Copyright IBM Corp.. Page 21 of 69 . 2004. 2000.

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. All rights reserved.. 2000. Page 22 of 69 . 2004.

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. 2004. Page 23 of 69 . All rights reserved. 2000..

Review © Copyright IBM Corp. Page 24 of 69 . All rights reserved.. 2004. 2000.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JOB Control Statements You would use the _______ statement to run a program as part of a job.

2000. Page 25 of 69 .SMITH EXEC PGM=PROGRAMA DD DSN=OUTPUT Continued« Concepts © Copyright IBM Corp.z/OS MVS JCL Introduction Unit: Introduction to JCL 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. Topic: JOB Control Statements //JOBNUM1 JOB //STEP1 //DD1 504. such as accounting information and conditions for job termination. All rights reserved. The JOB statement may also provide details and parameters that relate to the overall job.. 2004.

JONES Parts of a Job //JOBNUM2 JOB End of Job marker Concepts © Copyright IBM Corp.SMITH EXEC PGM=PROGRAMA DD DSN=OUTPUT 600.z/OS MVS JCL Introduction Unit: Introduction to JCL The JOB Statement (cont¶d) Each job must begin with a JOB statement. 2004. Page 26 of 69 . are parts of one job. The end of a job is marked by either another JOB statement or by a null statement. 2000. All statements that follow up to the next JOB statement.. All rights reserved. Topic: JOB Control Statements //JOBNUM1 JOB //STEP1 //DD1 504.

Identifies the job name and specifies accounting information Review © Copyright IBM Corp. Contains documentation information only B.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JOB Control Statements Which of the following is a function of the JOB statement? A. Identifies the program to be run C. Page 27 of 69 . 2004. 2000. Identifies the data sets to be used during the job D. All rights reserved..

z/OS MVS JCL Introduction Unit: Introduction to JCL The EXEC Statement An EXEC statement often follows the JOB statement. 2000. A job contains one or more EXEC statements. 2004. Page 28 of 69 . Programs are stored in program libraries and retrieved by the operating system when they are referenced by an EXEC statement.SMITH //STEP1 EXEC PGM=PROGRAMA //DD1 DD DSN=INPUT INPUT Concepts © Copyright IBM Corp. A job step ends with the next EXEC statement. each followed by statements that define one or more data sets needed for that job step. or a null statement. It names a program to be executed. the JOB statement for the next job. Program Library Topic: JOB Control Statements PROGRAMA //JOBNUM1 JOB 504.. All rights reserved.

All rights reserved. 2004. Tape devices D. Procedure libraries Review © Copyright IBM Corp. Page 29 of 69 . Program libraries C.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JOB Control Statements Where are programs referenced by an EXEC statement stored? A. Sequential data sets B.. 2000.

. All rights reserved. Page 30 of 69 .z/OS MVS JCL Introduction Unit: Introduction to JCL The DD Statement DD statements define the data sets the program uses during execution. Topic: JOB Control Statements Data Sets Continued« Concepts © Copyright IBM Corp. The order of DD statements within a job step is not usually significant. The number of DD statements following an EXEC statement depends on the number of data sets required by a program. 2000. 2004. Each data set used in the job requires at least one DD statement.

SMITH PGM=PROGRAMA DSN=OUTPUT DSN=INOUT Data Sets ‡ ‡ ‡ ‡ Concepts © Copyright IBM Corp. format.. 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.z/OS MVS JCL Introduction Unit: Introduction to JCL The DD Statement (cont¶d) The DD statement describes the data set extensively. 2004. All rights reserved. Page 31 of 69 . 2000. By using a proper combination of options. and blocking Request I/O devices Specify storage allocation for new data sets Topic: JOB Control Statements //JOBNUM1 //STEP1 //DD1 //DD2 JOB EXEC DD DD 504.

2004. All rights reserved. Review © Copyright IBM Corp. 2000.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JOB Control Statements The data set requirements for a program are described to the operating system by the __________ statements.. Page 32 of 69 .

Indicate where to store new data sets Review © Copyright IBM Corp.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JOB Control Statements Which of the following functions can DD statements perform? A. 2004.. All rights reserved. Page 33 of 69 . Initiate a new program D. 2000. Tell the system which data set to access B. Request a printer to produce the job output C.

Page 34 of 69 ..z/OS MVS JCL Introduction Unit: Introduction to JCL Grouping Programs When deciding which programs to group together as a single job. 2004. you may consider programs that: ‡ ‡ ‡ Have to run sequentially Have the same job accounting information Are dependent on each other Topic: JOB Control Statements Continued« Concepts © Copyright IBM Corp. 2000. All rights reserved.

they can be grouped into a single job. INPUT ‡ Program B uses the data set created by Program A as its input and creates two more data sets called OUTPUT1 and OUTPUT2. 2004. INOUT Can you group Program A and Program B? Since these programs must run sequentially and Program B is dependent on Program A. 2000.. Topic: JOB Control Statements OUTPUT1 Concepts OUTPUT2 Page 35 of 69 © Copyright IBM Corp. .z/OS MVS JCL Introduction Unit: Introduction to JCL 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. All rights reserved.

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.DELETE) Continued« Concepts © Copyright IBM Corp. DISP=(NEW.SMITH EXEC PGM=PROGRAMA DD DSN=INPUT. 2000.DELETE) DD DSN=OUTPUT2. One for each of the following: ‡ ‡ INPUT INOUT //JOBNUM1 //STEP1 //DD1 // //DD2 // //STEP2 //DD3 // //DD4 // //DD5 // JOB 504. Page 36 of 69 . All rights reserved.CATLG. DISP=(OLD. DISP=(NEW.CATLG) DD DSN=OUTPUT1. 2004. DISP=(NEW. two data definition statements are needed. an EXEC statement marks the beginning of the first job step (STEP1) and invokes a program called PROGRAMA. In the example. DISP=SHR DD DSN=INOUT.PASS) EXEC PGM=PROGRAMB DD DSN=INOUT. Because PROGRAMA uses one data set to create another.CATLG..

SMITH EXEC PGM=PROGRAMA DD DSN=INPUT. one for each of the following: ‡ ‡ ‡ INOUT OUTPUT1 OUTPUT2 //JOBNUM1 //STEP1 //DD1 // //DD2 // //STEP2 //DD3 // //DD4 // //DD5 // JOB 504.CATLG) DD DSN=OUTPUT1.z/OS MVS JCL Introduction Unit: Introduction to JCL Topic: JOB Control Statements Grouping Programs: An Example (cont¶d) When the system invokes PROGRAMB.PASS) EXEC PGM=PROGRAMB DD DSN=INOUT. All rights reserved. which is STEP2.CATLG. 2004. Page 37 of 69 .CATLG. DISP=(NEW. 2000. DISP=(NEW.DELETE) DD DSN=OUTPUT2. DISP=(OLD. another step begins in the job. Because PROGRAMB uses the output of PROGRAMA as input and then creates two output data sets of its own. DISP=(NEW. DISP=SHR DD DSN=INOUT.DELETE) Concepts © Copyright IBM Corp. PROGRAMB needs three data definition statements..

It is coded with two forward slashes (//) in positions 1 and 2 and no other characteristics.SMITH //* COMMENTS CAN GO HERE //STEP1 EXEC PGM=PROGRAM1 //DD1 DD DSN=TRANS1. 2000. // DISP=OLD // Comment statement Null statement Topic: JOB Control Statements ‡ Concepts © Copyright IBM Corp. All rights reserved. there are some less frequently used JCL statements. 2004. These include: ‡ Comment statements: You can use these to document JCL statements. //JOBNUM1 JOB 504. EXEC and DD statements. Null statements: You can use a null statement to mark the end of a job.z/OS MVS JCL Introduction Unit: Introduction to JCL Other JCL Statements Besides the JOB. A comment statement is coded with two forward slashes and an asterisk (//*) in the first 3 positions. Page 38 of 69 . The comment text is coded in positions 4 through 71..

2000. Programs must be dependent on each other C. Programs must run sequentially B.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JOB Control Statements Which of the following are considerations for determining which programs should be grouped together as a job? A.. Page 39 of 69 . Programs must access the same databases D. All rights reserved. 2004. Programs must have the same accounting information Review © Copyright IBM Corp.

2004.. Two B. a program uses the output from a previous job step as its source data. Three D. How many DD statements would you find in the JCL for this job step? A. All rights reserved. Four Review © Copyright IBM Corp.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JOB Control Statements During the course of a job. One C. 2000. Page 40 of 69 . and then creates a new data set and copies it to another storage device.

± Transfer of data into a computer and from the computer to the outside world. ± A blank statement beginning with a double slash (//) that marks the end of a job. 2000.z/OS MVS JCL Introduction Unit: Introduction to JCL Glossary Comment statements ± The comment statement is used primarily to document a program and its resource requirements.. 2004. Topic: JOB Control Statements Input/Output (I/O) Null Glossary © Copyright IBM Corp. Page 41 of 69 . All rights reserved.

2000.z/OS MVS JCL Introduction Unit: Introduction to JCL Topic Summary Now that you have completed this topic. All rights reserved. 2004. 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: JOB Control Statements ‡ ‡ Summary © Copyright IBM Corp. 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.. Page 43 of 69 . All rights reserved. 2004.

2004. you will be able to: ‡ ‡ Define the nature and function of each field Code each field using the correct procedure Topic: JCL Statement Syntax Introduction © Copyright IBM Corp. 2000. All rights reserved..z/OS MVS JCL Introduction Unit: Introduction to JCL Topic Objectives At the end of this topic. Page 44 of 69 .

All rights reserved. 2004..z/OS MVS JCL Introduction Unit: Introduction to JCL JCL Statement Fields Most JCL statements have the same format consisting of five fields. 2000. Page 45 of 69 . which are as follows: ‡ ‡ ‡ ‡ ‡ The identifier field The name field The operation field The parameter field The comment field Topic: JCL Statement Syntax Concepts © Copyright IBM Corp.

It usually contains two forward slashes (//) and indicates that the statement is a JCL statement (as opposed to a data record).. All rights reserved. 2004.z/OS MVS JCL Introduction Unit: Introduction to JCL The Identifier Field Identifier Field Name Field Operation Field Parameter Field Comment Field Topic: JCL Statement Syntax // JOBNUM1 1 2 3 JOB 501. 2000. The remaining four fields must be coded from position 3 through position 71. Page 46 of 69 .SMITH COMMENT 71 The identifier field occupies positions 1 and 2. Concepts © Copyright IBM Corp. Always code the JCL statement field in the order shown here.

SMITH COMMENT 71 The name field must begin in position 3 with no spaces between the identifier and the name fields.. but is required on JOB and almost all DD statements.z/OS MVS JCL Introduction Unit: Introduction to JCL The Name Field Identifier Field Name Field Operation Field Parameter Field Comment Field Topic: JCL Statement Syntax // JOBNUM1 1 2 3 JOB 501. All rights reserved. The name field identifies the JCL statement by name so that other JCL statements or the operating system can refer to it. Page 47 of 69 . A name is optional for some EXEC statements. Concepts © Copyright IBM Corp. 2000. 2004.

2004. 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 Page 48 of 69 //JOB1 JOB 504.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: ‡ ‡ The name must begin in position 3 The name can be one to eight characters in length Name Field ‡ The first character in the name must be alphabetic character (A to Z) or national character (#.DISP=SHR ‡ ‡ ‡ Concepts © Copyright IBM Corp. 2000. $).. All rights reserved. .SMITH //STEP1 EXEC PGM=PROGRAMA //DD1 DD DSN=INPUT. @.

Parameter 2. Page 49 of 69 .z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JCL Statement Syntax Match each JCL field types with their main function 1. Comments 3. 2000. All rights reserved. Contains specific statement values D. Identifies a JCL statement Review © Copyright IBM Corp. Specifies the type of statement C. Contains documentation information from the JCL coder B. Operation 4. 2004.. Name A.

2000. All rights reserved. //$ABCD D.. // JOB13 C. Page 50 of 69 .z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JCL Statement Syntax Which of the following is a valid JOB name? A. //STEPSEVEN Review © Copyright IBM Corp. 2004. //TEST*1 B.

All rights reserved.SMITH COMMENT 71 The operation field defines the JCL statement type . EXEC. the operation field must follow the name field and it must be preceded by at least one blank space.JOB.. Page 51 of 69 . 2004. Concepts © Copyright IBM Corp. For every JCL statement. or DD. 2000.z/OS MVS JCL Introduction Unit: Introduction to JCL The Operation Field Identifier Field Name Field Operation Field Parameter Field Comment Field Topic: JCL Statement Syntax // JOBNUM1 1 2 3 JOB 501.

. and DD. All rights reserved. 2004.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. 2000. the operation fields contain the operators JOB. 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 Field //JOB1 JOB 504. EXEC.DISP=SHR ‡ ‡ Concepts © Copyright IBM Corp.SMITH //STEP1 EXEC PGM=PROGRAMA //DD1 DD DSN=INPUT. Page 52 of 69 .

2004. All rights reserved.SMITH COMMENT 71 The parameter field contains one or more parameters separated by commas. 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 Concepts © Copyright IBM Corp. 2000..z/OS MVS JCL Introduction Unit: Introduction to JCL The Parameter Field Identifier Field Name Field Operation Field Parameter Field Comment Field Topic: JCL Statement Syntax // JOBNAME 1 2 3 JOB 501. EXEC and DD statement has its own set of parameter information. Each JOB. Page 53 of 69 .

2000. MSGLEVEL=(1. © Copyright IBM Corp. 2004. Concepts Page 54 of 69 .SMITH. TIME=4 DSN=INPUT.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.0) PGM=PROGRAM1. All rights reserved.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: ‡ ‡ The first one specifies the data set name TRANS1 The second one specifies a status of OLD..

z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JCL Statement Syntax Place the following fields in the order in which they appear in a JCL statement (from first to last). Identifier Review © Copyright IBM Corp. Name B. 2004. 2000. A. Parameter E.. Comment C. Page 55 of 69 . All rights reserved. Operation D.

2004. Data set name C. SMITH 2. Programmer's name Review © Copyright IBM Corp. All rights reserved.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JCL Statement Syntax Match the following parameters with their descriptions: 1. Maximum run time for the program B. 2000. TIME=4 3. Page 56 of 69 .. DSN=TRANS1 A.

Page 57 of 69 . All rights reserved. 2004. You want to make it easier to read all the parameters.. 2000. For example: You could code one parameter per line.z/OS MVS JCL Introduction Unit: Introduction to JCL 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. Topic: JCL Statement Syntax Concepts © Copyright IBM Corp.

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

. // TIME=1. // PARM=LIST Blank position ‡ ‡ Concepts © Copyright IBM Corp. indicates that the second line is a continuation of the first line The blank in position 3 of the third line. Page 61 of 69 . following the ending comma on the first line. following the ending comma on the second line.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. 2000. All rights reserved. indicates that the third line is a continuation of the second line //STEP1 EXEC PGM=PROGRAMA. after the identifier field (//) The blank in position 3 of the second line. All 3 lines comprise one JCL statement. 2004. In this example. note the following: ‡ The second and the third lines each have a blank in position 3.

z/OS MVS JCL Introduction Unit: Introduction to JCL The Comment Field Identifier Field Name Field Operation Field Parameter Field Comment Field Topic: JCL Statement Syntax // JOBNUM1 1 2 3 JOB 501.. 2004. All rights reserved. It is a good programming practice to put comments in your JCL statements wherever possible. A comment field must follow the parameter field and must be preceded by one or more blanks. 2000. It contains documentation relating to the code or other messages from the programmer. Concepts © Copyright IBM Corp.SMITH COMMENT 71 A comment field contains extra documentation which you may choose to include. Page 62 of 69 .

A blank separates the parameter field from the words INVENTORY JOB. All rights reserved.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 .KAY INVENTORY JOB Concepts © Copyright IBM Corp.. 2000.'INVENTORY JOB'. 2004. Page 63 of 69 . //JOB1 JOB 504.

//PAY JOB 03948. All rights reserved.FRASER=(1.0) C. 2000. //XYZ DD DSN Review © Copyright IBM Corp. 2004. A.z/OS MVS JCL Introduction Unit: Introduction to JCL Are We on Track? Topic: JCL Statement Syntax Place the following JCL statements in the correct order.. //STEP1 EXEC PGM=PROG1 B. Page 64 of 69 .

The name field must begin in position 3. For example. 2000. A continuation line begins with //. Continuing parameters must start in positions 4 through 16. Each subsequent field must be preceded by one or more spaces. 2004. Page 65 of 69 . Do not embed blanks within any field. do not code a blank to separate parameters in the parameter field. All rights reserved.. Do not code past position 71. ‡ Concepts © Copyright IBM Corp.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: ‡ ‡ ‡ ‡ ‡ ‡ The identifying characters (//) must be in positions 1 and 2.

± Numbers 0 through 9. All rights reserved. or the pound sign [#]. ± The parameter field contains statement parameters separated by commas. for the command statement.z/OS MVS JCL Introduction Unit: Introduction to JCL Glossary Alphabetic Characters ± Capital A to capital Z. ± The identifier field indicates to the system that a JCL statement rather than data. 2000. or. the command. Page 66 of 69 . Comment Field ± The comment field contains documentation relating to the code or other messages from the programmer. 2004. ± The operation field specifies the type of statement. the dollar sign [$]. Topic: JCL Statement Syntax Identifier Field Name Field National Characters Numeric Characters Operation Field Parameter Field Glossary © Copyright IBM Corp.. ± The national characters are the at sign [@]. ± The name field identifies a particular statement so that other statements and the system can refer to it.

plus sign [+]. equal sign [=].z/OS MVS JCL Introduction Unit: Introduction to JCL Glossary (cont¶d) Special Characters ± These include ampersand [&]. hyphen [-]. Page 67 of 69 . asterisk [*].].]. slash [/]. exclamation mark [!]. 2004. period [. 2000. right parenthesis [)] ± Parameters and variables contained within positional and keyword parameters that further qualify or define the settings or actions coded in a statement. comma [. left parenthesis [(]. Topic: JCL Statement Syntax Subparameter Glossary © Copyright IBM Corp.. All rights reserved.

you should be able to: ‡ ‡ Define the nature and function of each field Code each field using the correct procedure Topic: JCL Statement Syntax Summary © Copyright IBM Corp. 2004..z/OS MVS JCL Introduction Unit: Introduction to JCL Topic Summary Now that you have completed this topic. Page 68 of 69 . 2000. All rights reserved.

2004. All rights reserved. 2000.z/OS MVS JCL Introduction Unit: Introduction to JCL Unit Summary Now that you have completed this unit.. Page 69 of 69 . 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 ‡ ‡ ‡ ‡ Summary © Copyright IBM Corp.