DEV Community

Gaetano D'Orsi
Gaetano D'Orsi

Posted on

A minimal example of JCL

During these weird days of pandemic, I have read a lot of fun and interesting affairs about COBOL language for a while time I decided to get a bit into the detail of language and discovered that in the actual world of Mainframe not is banal getting productive and make the things work into the fascinating world of "Big Irons".

One of the most important and significative tools that every Mainframe expert should be mastering is JCL.

JCL is the acronym of Job Control Language a declarative scripting language that allows application developers for literally talking with the z/OS, the operating system for mainframes.

Usually, a single JCL row is structured with 5 essential columns filled with fixed order and first three mandatory:

1) Double slashes (//) for start job.
2) A Job name.
3) An operation instruction.
4) Parameter instructions.
5) Comments, indicated with /* symbol in start line as well.

A simple JCL script that prints a Hello World string using the IBM copy program called IEBGENER looks like this:

  /* Start of JCL Job 
  //JCLPRGR  JOB
  //STEP1 EXEC PGM=IEBGENER COMMENT: EXECUTION COMMAND
  //* Data to be copied
  //SYSUT1   DD *
  Hello, world JCL!
  //* printing Hello, world JCL! string to the system output
  //SYSUT2   DD SYSOUT=A
  //SYSPRINT DD SYSOUT=A
  //SYSIN    DD DUMMY
  //
Enter fullscreen mode Exit fullscreen mode

JOB identifies the start of the job.
EXEC is used to identifying the name of an execution unit program or procedure to be executed (in our case the IEBGENER program).
Data Definition (DD) is used to connect program file names used by the program indicated in the EXEC operation.

In our case, we don't handle any file but we using standard output with the SYSOUT parameter.
The DUMMY parameter means that nobody device or external storage space is to be used to the system Data Set that is a special type file in a Mainframe Environment.

Finally, we have another "//" at the end of the script with null instructions which points to the end of the job execution.

Here we go!

JCL is a broad argument and there are plenty of books, manuals, and guides for mastering to build and create very powerful scripts, and also IBM itself provides various resources for learning it.

A few links:
IBM JCL concepts
IBM JCL User Guide
IBM JCL Reference Guide
JCL tutorial

Top comments (0)