Job Control Language

from Wikipedia, the free encyclopedia

Job Control Language ( JCL ) is the control language for batch processing in a mainframe environment and is one of the scripting languages . The task of JCL is to specify the programs to be executed, their sequence and a runtime environment (connection to physical hardware, i.e. the input and output devices and files). The programs or program sequences belonging to a specific task and the required environment are bundled in so-called jobs with the help of JCL , which are defined as executable units in the context of multitasking . The jobs represent a higher level than the actual application programs on the system level and are in this respect comparable to the shell scripts in Unix or the batch files in MS-DOS or Windows .

This article describes the JCL on IBM - z / OS . Other mainframe operating systems such as VSE also use languages ​​called JCL, but they have a completely different syntax .

development

The JCL used today on systems under z / OS was developed in 1964 for OS / 360 IBM. Downward compatibility was guaranteed during further development.

Originally, JCL was stored on punch cards. The jobs were then imported into the system using a card reader. Today JCL libraries partitioned datasets with the FB (Fixed Blocked) dataset format and a dataset length of 80 are common. The term card for a JCL statement is still in use.

processing

JCL is read in and interpreted by the Job Entry Subsystem (JES2 or JES3).

The subsystems, system functions (started tasks) and the logins of a user at the TSO also use JCL procedures for initialization.

instructions

All instructions begin with //. Comments are //*marked with . It is possible to enter data for the standard input directly in the JCL.

The most important instructions are:

  • JOB (information about batch processing to be carried out)
  • EXEC (execute a program or a procedure)
  • DD (data definition, assignment "file" in the program to physical file)
  • PROC and PEND to define local or global procedures

A program execution that is started with an EXEC statement is called a step (processing step). It is possible to make the execution of steps dependent on the return values ​​of earlier steps (condition code). There is a simple IF-THEN-ELSE logic for this, with the help of which one can execute blocks of instructions (steps) conditionally. Loops are not possible during job processing, the steps are always executed sequentially.

A direct reference back to the input and output data of a previous step is possible in order to use them further in the following steps.

The use of variables (symbols) in the JCL is possible, but there are some restrictions. Variables can only be used to change parts of the JCL before the job is executed. At runtime, only the return codes of the individual steps can influence the job flow.

A job is either started automatically and time-controlled via a scheduling system or can also be triggered directly (usually via ISPF ).

Examples

Example 1 :

 //JOB1   JOB (12345),MSGCLASS=X,NOTIFY=SYSPROG1
 //STEP1 EXEC PGM=IEFBR14
 //DD1     DD DSN=AB.CD.EFGH,DISP=(OLD,DELETE)

This job deletes the cataloged file AB.CD.EFGH. The executed program IEFBR14 is a dummy program. This is only necessary because the JCL interpreter expects a program or procedure call with each step. The user SYSPROG1 is informed of the execution status after the job has ended. In this case return code  0 (= OK) or "JCL ERROR" if the job was encoded incorrectly or if the corresponding file does not exist.

The assignment of the file AB.CD.EFGH to the DD name DD1 is arbitrary in this case, because it is not used by the called program.

Procedure (simplified):

  • The file is allocated (1st DISP parameter OLD → exclusive access) and assigned the DD name DD1. (Step preallocation)
  • The dummy program is called.
  • The file is deleted (2nd DISP parameter DELETE, step post-processing)

Example 2 :

 //JOB2     JOB (123456),MSGCLASS=X
 //STEP1   EXEC PGM=SALDO
 //STEPLIB   DD DISP=SHR,DSN=BH.PROD.LOAD
 //          DD DISP=SHR,DSN=BH.PROD.LOAD2
 //INPUT     DD DISP=SHR,DSN=BH.DETAIL.BESTAND
 //LISTE     DD SYSOUT=*

Here the application program SALDO is executed, the load module is first searched for in the libraries BH.PROD.LOAD and BH.PROD.LOAD2, then in system libraries. With read access to files, several data records can be concatenated under one DD name.

The SALDO program is to read its input data from the BH.DETAIL.BESTAND file and write the results to a spool file (DD name LISTE). The assignment of the input data record to the DD name "INPUT" or the output to "LISTE" is specified by the program (logical file name).

Example 3 :

 //JOB3    JOB (123456),MSGCLASS=X
 //STEP1  EXEC PGM=IDCAMS
 //DDIN     DD DISP=SHR,DSN=SYSPROG.SMF.AUSWERT
 //DDOUT    DD DISP=(NEW,CATLG),DSN=SYSPROG.SMF.HISTORY(+1),
 //            UNIT=SYSDA,SPACE=(CYL,(15,15),RLSE),DCB=*.DDIN
 //SYSPRINT DD SYSOUT=*
 //SYSIN    DD *
  REPRO INFILE(DDIN) OUTFILE(DDOUT)
 /*

Here the file SYSPROG.SMF.AUSWERT is copied into a new generation of the " Generation Data Group " (GDG) SYSPROG.SMF.HISTORY with the system utility IDCAMS . The log of this action (SYSPRINT) is written to a spool file, the control instruction for IDCAMS (REPRO-Command) was coded in the standard input SYSIN, which is concluded with. /*

literature

  • Michael Winter: MVS / ESA JCL: Introduction to Practice . Oldenbourg Wissenschaftsverlag, 1999, ISBN 978-3-486-25058-9
  • Gary DeWard Brown, Michael Teuffel: zOS / JCL: Job Control Language in the z / OS MVS operating system . Oldenbourg Wissenschaftsverlag, 2004, ISBN 978-3-486-27397-7

Web links

Individual evidence

  1. ^ IBM Knowledge Center, Pseudo-JCL Syntax