Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
🖥 JCL

Introduction to JCL

Beginner 🕑 20 min read 👁 1 views

What is JCL?

JCL (Job Control Language) is a scripting language used on IBM mainframes to instruct the system on how to run batch jobs. It tells the operating system what program to execute, what files to use, and how to handle output.

JCL Statements

There are three main types of JCL statements:

  1. JOB Statement - Identifies the job to the system
  2. EXEC Statement - Identifies the program or procedure to execute
  3. DD Statement - Defines the data sets used by the program

JCL Syntax Rules

  • Statements start with // in columns 1-2
  • Name field starts in column 3
  • Operation field follows name
  • Parameters follow operation
  • Comments start with //*
  • Continuation uses // in columns 1-2 with parameter in column 16

Statement Format

//NAME    OPERATION  PARAMETERS

Key Concepts

  • Job - Unit of work submitted to the system
  • Step - Individual program execution within a job
  • Data Set - A file in mainframe terminology
  • SYSOUT - System output for printed reports

Code Example

//MYJOB01  JOB (ACCT),"MY FIRST JOB",
//             CLASS=A,
//             MSGCLASS=X,
//             NOTIFY=&SYSUID
//*
//* THIS IS A COMMENT
//*
//STEP01   EXEC PGM=IEFBR14
//*
//STEP02   EXEC PGM=MYCOBOL
//STEPLIB  DD DSN=MY.LOAD.LIBRARY,DISP=SHR
//INPUT    DD DSN=MY.INPUT.FILE,DISP=SHR
//OUTPUT   DD DSN=MY.OUTPUT.FILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(10,5),RLSE),
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//