Job Control Language
  Home  EXEC Statements  Procedure  Utilities  Tutorials  Example   Refrence   Abends Codes                        


What is JCL?

Job Control Language (JCL) is used to tell the system what program to execute, followed by a description of program inputs and outputs. It is possible to submit JCL for batch processing or start a JCL procedure (PROC), which is considered a started task. The details of JCL can be complicated but the general concepts are quite simple. Also, a small subset of JCL accounts for at least 90% of what is actually used. This section discusses selected JCL options.

While application programmers need some knowledge of JCL, the production control analyst responsible must be highly proficient with JCL, to create, monitor, correct and rerun the company's daily batch workload.

There are three basic JCL statements:

JOB Provides a name (jobname) to the system for this batch workload. It can optionally include accounting information and a few job-wide parameters.

EXEC Provides the name of a program to execute. There can be multiple EXEC statements in a job. Each EXEC statement within the same job is a job step.

DD The Data Definition provides inputs and outputs to the execution program on the EXEC statement. This statement links a data set or other I/O device or function to a ddname coded in the program. DD statements are associated with a particular job step.

Basic JCL coding syntax shows the basic JCL coding syntax.


In Interacting with z/OS, we executed the same routine from the TSO READY prompt. Each JCL DD statement is equivalent to the TSO ALLOCATE command. Both are used to associate a z/OS data set with a ddname, which is recognized by the program as an input or output. The difference in method of execution is that TSO executes the sort in the foreground while JCL is used to execute the sort in the background.

When submitted for execution:

MYJOB Is a jobname the system associates with this workload.

MYSORT Is the stepname, which instructs the system to execute the SORT program.

SORTIN On the DD statement, this is the ddname. The SORTIN ddname is coded in the SORT program as a program input. The data set name (DSN) on this DD statement is ZPROF .AREA.CODES. The data set can be shared (DISP=SHR) with other system processes. The data content of ZPROF .AREA.CODES is SORT program input.

SORTOUT This ddname is the SORT program output.

SYSOUT SYSOUT=* specifies to send system output messages to the Job Entry Subsystem (JES) print output area. It is possible to send the output to a data set.

SYSIN DD * is another input statement. It specifies that what follows is data or control statements. In this case, it is the sort instruction telling the SORT program which fields of the SORTIN data records are to be sorted.

We use JCL statements in this text; some z/OS users use the older term JCL card, even though JCL resides in storage rather than punched cards.