| Subcribe via RSS

Let’s start with JCL

August 29th, 2009 | No Comments | Posted in IBM system z |

You probably know PHP, Java, C, and lot of other programming languages, but what about JCL ? No, it’s not about Java, it’s about Job Control Language a scripting language used on mainframe to instruct the system on how to run a batch job. It is possible to submit JCL for batch processing or directly by to start a JCL procedure (PROC). JCL is very important to create, check, correct and run the daily batch workload.

It’s easy, you have three basic  statements:

  • JOB: Provides a name (jobname) for the batch.
  • EXEC: Provides the name of a program to execute.
  • DD: For Data Definition, provides inputs/outputs to the program.

Let’s see a JCL example:

//MYJOB     JOBTES 1
//MYSORT    EXEC PGM=SORT
//SORTIN    DD DISP=SHR,DSN=SUP01.TAB.TEST
//SORTOUT   DD SYSOUT=*
//SYSOUT    DD SYSOUT=*
//SYSIN     DD *
SORT FIELDS=(1,4,CH,A)
/*

Now, try to understand what’s happen here.

  • MYJOB is the jobname associates to the workload, here it’s “JOBTES”.
  • MYSORT is the stepname, which ask the system to execute a program called “SORT”.
  • SORTIN is the program input, here with the DSN (Data Set Name) SUP01.TAB.TEST, and the dataset can be shared (DISP=SHR).
  • SORTOUT is the SORT program output.
  • SYSOUT specifies to send system output to JES (Job Entrey Subsystem), but it’s also possible to send the outpu to a dataset.
  • SYSIN tell the SORT program which fields of the SORTIN data records are to be sorted.

Enough for the moment, JCL is quite hard at beginning !

Tags: ,