1. Get TK4- MVS Sofware
  2. Get wc3270 Terminal Emulator
  3. Install wc3270 Terminal Emulator
  4. Install and Run MVS 3.8j
  5. Logging In to/Out of MVS 3.8j
  6. Shutting down MVS 3.8j from TSO
  7. Using TSO RFE Application
  8. Adding a User
  9. Creating Datasets
  10. JCL Overview
  11. Your First Cobol Program
  12. Your First Assembler Program
  13. Your First Fortran Program
  14. Your First PL/1 Program

JCL Overview

Introduction to JCL

This is a short introduction to JCL and how to use it. It shows a number of the parameters for the various JCL statements but does not describe all possible parameters.

JCL was introduced with the first IBM Mainframe and is still used on the newest z/OS system. As new systems have come out features have been added by the JCL on the OS/360 computer is very much alive on newer machines. The original mainframe computers had card readers, tapes, and printers. This was the situation with MFT and MVT, the immediate predecessors to MVS. Even today most mainframes still have card readers.

To run a job a deck of cards would be created and read into the system by the card reader. The system would see the jcl and would execute it. On MVS 3.8J it is possible to submit a text file containing jcl lines to the card reader. It is also possible and quite common to put the JCL in a partitioned data set and submit the job from there. Here is a picture of a simple job from a PDS.



A job consists of three kinds of statements; JOB, EXEC, and DD. The JOB statement provides parameters and keywords about the entire job. The EXEC statement describes programs that are to be executed. There may be more than one EXEC statement in a job stream. Each EXEC statement is called a step. The DD statement describes the datasets, printers, and other devices that the EXEC program requires to execute.

While talking about jcl is is common to use the term "card" instead of "record" or "row". In this tutorial "card" will be used.

JCL Card Definition

A jcl card card be split up into four sections.

  • Identifier Field
  • Name Field
  • Operation Field
  • Parmeters Field

The job card is the card that defines the job. It beings with two slashes (//). The next up to eight characters is the job name. The name can be from 1 to 8 characters long. It is followed by at least one space after which is the word 'JOB'. Following the word is at least one space.

After the work JOB are positional and keyword values that provide some parameters to the job. Each parameter is seperated by a comma (,). If there are spaces in a paramter it must be inclosed by single quotes. Otherwise it will be the termination of the job card since the first space after the paramters have started indicates the end of card. A job card can be continued to multiple cards by ending the last parameter on the card with a comma (,). The next card begins with two slashes (//) followed by at least one space before the next parameter. The first parameter is positional and is job accounting information. Many production systems use accounting parameters on jcl to spread computing costs to various departments. The second parameter is also positional and is the programmer name. Both the first and second parameters are optional.

The keyword parameters begin with the keyword and are immediately followed by an equals sign (=). The keywords for the JOB card are:
KeywordValue
USERThe userid underwhich the job will run
PASSWORDThe userid's password
NOTIFYThe userid of the TSO user to be notified when the job is finished
CLASSA single character that the system uses to schedule the job. 'A' is quite common
MSGCLASSA single character that determines where the output goes. The values assigned by mvs are:
CodeDescription
APrinter1
XPrinter3
ZPrinter2
MSGLEVELConsists of a (stmt,msg) I.E. MSGLEVEL=(stmt, msg) where there values are one of the following:
stmt
0Print only the job statement
1Print only jcl statements including those from procedures
2Print only jcl statements from the input stream
msg
0Print step completion messages. If job fails also print allocation and deallocation messages
1Print all messages
REGIONSpace to run under. IE '9000k' is 1 meg.
TIME([min][,sec]) Maximum minutes and seconds to run.

Exec Statement

The EXEC card begins with two slashes (//), followed by a name, followed by at least one blank, followed by the word EXEC, followed by at least one blank followed by PGM=program where progam is a program that can be loaded from the system. An EXEC card is considered to be a step. It is followed by the DD cards. After the DD cards another step can be started by having another EXEC statement. Some jobs can have 20 or more steps.

DD Statement


A DD statement allows a program to communicate with devices outside of the program itself. A DD statement consists of from one to just about any number of cards. The statement begins with two slashes (//) followed by the name that the program uses to refer to the statement. That name is followed by at least one space and then the characters DD. The DD may be followed by one of three types of parameters. These parameter are:

ParameterDescription
*DD consists of inline data. The lines immediately following the DD statement is data that the program uses. The data is terminated when a line consisting of '/*' is encountered.
DUMMYThe file needs the DD be defined but there is no data for an input DD and no destination for any output using the DD
KEYWORD=One of a number of keywords followed by the equals sign followed by the value(s) for the keyword. Some of these are DSNAME, DSN, DISP, SYSOUT, SYSDA, UNIT, VOL=SER, SPACE, and DCB.

The uses of these parameters and keywords will be explained as we need them when we develop programs and utilities.

Ending a JCL Job Stream

When all of the EXEC steps and their DD definitions have been entered a job stream is closed by a card with two slashes(//). Technically the two slash card is not required. However if there is a submission of more than one job in a stream of cards the two slashes are how the system knows the job is at an end. Then when it reads the next JOB card it will not register an error.