In this section, we will explore the fundamental JCL statements that form the backbone of any JCL job. Understanding these statements is crucial for writing and managing JCL scripts effectively.
Key JCL Statements
JCL primarily consists of three types of statements:
- JOB Statement
- EXEC Statement
- DD Statement
- JOB Statement
The JOB statement marks the beginning of a JCL job and provides information about the job to the operating system. It includes details such as job name, accounting information, and job-level parameters.
Syntax:
Example:
Explanation:
MYJOB
: The name of the job.(12345)
: Accounting information.'Sample Job'
: Description of the job.CLASS=A
: Specifies the job class.MSGCLASS=X
: Specifies the message class for job output.
- EXEC Statement
The EXEC statement specifies the program or procedure to be executed. It can also pass parameters to the program.
Syntax:
Example:
Explanation:
STEP1
: The name of the step.PGM=IEFBR14
: Specifies the program to be executed (IEFBR14 is a dummy program).
- DD Statement
The DD (Data Definition) statement describes the data sets used in the job. It specifies the input and output data sets, their attributes, and how they should be handled.
Syntax:
Example:
Explanation:
SYSIN
: The name of the data definition.DD *
: Indicates that the data follows in-stream.This is input data
: The actual data./*
: End of in-stream data.
Practical Example
Let's combine these statements into a simple JCL job that runs a program and uses an input data set.
Example:
//MYJOB JOB (12345), 'Sample Job', CLASS=A, MSGCLASS=X //STEP1 EXEC PGM=IEFBR14 //SYSIN DD * This is input data /*
Explanation:
- The
JOB
statement defines the job with nameMYJOB
. - The
EXEC
statement specifies that the programIEFBR14
should be executed. - The
DD
statementSYSIN
provides in-stream input data to the program.
Summary
In this section, we covered the three primary JCL statements:
- JOB Statement: Defines the job and provides job-level parameters.
- EXEC Statement: Specifies the program or procedure to be executed.
- DD Statement: Describes the data sets used in the job.
Understanding these statements is essential for writing effective JCL scripts. In the next section, we will dive deeper into each of these statements, starting with the JOB statement.
JCL (Job Control Language) Course
Module 1: Introduction to JCL
Module 2: JCL Statements and Syntax
Module 3: Data Definition (DD) Statements
Module 4: Procedures and Symbolic Parameters
Module 5: Advanced JCL Concepts
- Conditional Processing
- JCLLIB and INCLUDE Statements
- Generation Data Groups (GDGs)
- Restart and Checkpoint
Module 6: Error Handling and Debugging
- Common JCL Errors
- Interpreting JCL Error Messages
- Debugging Techniques
- Using JES2/JES3 for Troubleshooting