Understanding the JCL(Job Control Language)

If you're new to mainframe computing, Job Control Language (JCL) is a key skill you'll need. Think of it as the set of instructions you give the mainframe to execute specific tasks, like running programs or managing datasets. It doesn’t perform the calculations or logic itself but tells the system what to do, step by step. Whether you’re creating files, processing payroll data, or managing daily logs, JCL acts as the blueprint for the system to follow.

What is JCL and Why Is It Important?

JCL is short for Job Control Language. It’s the language used to communicate with IBM mainframe systems. Unlike general-purpose programming languages, JCL is specific to defining jobs a sequence of steps where each step performs a distinct function.

For example:

  1. Step 1: Read input data from a file.

  2. Step 2: Run a program to process the data.

  3. Step 3: Write the output to a new file.

Without JCL, mainframes wouldn’t know what tasks to perform, which resources to allocate, or where to store the results.

Breaking Down a JCL Job

Every JCL script is structured into three main sections:

  1. JOB Statement: Introduces the job to the system and specifies its overall parameters.

  2. EXEC Statement: Defines the program or procedure to run in each step.

  3. DD (Data Definition) Statements: Specify the datasets and system resources needed for each step.

Example:

//MYJOB JOB (12345,67890),'Demo Job',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID

//STEP1 EXEC PGM=IEFBR14

//MYDATA DD DSN=MY.TEST.FILE,DISP=(NEW,CATLG,DELETE),

// SPACE=(CYL,(5,5)),UNIT=SYSDA,LRECL=80,RECFM=FB

What’s Happening Here?

  1. The JOB Statement introduces the job and sets global parameters, such as:

  • CLASS=A: Assigns the job a priority.

  • MSGCLASS=X: Specifies where logs are sent.

  • NOTIFY=&SYSUID: Notifies the job submitter upon completion.

  1. The EXEC Statement

specifies that the IEFBR14 utility is being executed. This utility doesn’t do much other than allocate or delete datasets, but it’s commonly used for testing.

  1. The DD Statement defines a new dataset called MY.TEST.FILE

  • DISP=(NEW,CATLG,DELETE): Creates the dataset, catalogs it on success, and deletes it if the job fails.

  • SPACE=(CYL,(5,5)): Allocates space for the dataset in cylinders.

  • LRECL=80 and RECFM=FB: Define the record length and format.

Last updated