Introduction to JCL
This article provides a basic coverage on concepts of MVS/JCL .The topics covered in this article are – Introduction to Job Control language, Basic concepts of JCL, Job & Job steps, Concepts of Job Statements and Positional & Keyword parameters.
It is a Batch operating environment. In batch mode we submit or send processing request (JCL) to the system and then we can do some other tasks namely, one can read a book, do some other program etc. Our processing request is put into queue along with the line of other requests submitted by other people. The system will ultimately get around to our request, process it, and return the results to us. Batch mode is generally cheaper than interactive mode. Interactive mode demands a higher level of service from MVS and requires fast response time
MVS uses a JOB entry subsystem (JES) to receive jobs into the operating
system, schedule them for processing by MVS, and to control their output processing. There are two types of JES. They are namely:
With JES, MVS operates more efficiently
A JOB is the execution of one or more related programs in sequence. Each
program to be executed by a JOB is called a JOB STEP.
Suppose you want to process a JOB that executes two programs. The first does sort on the input file and second prints a report. The JCL will have two JOB steps as follows:
//ABCDE JOB ….
//STEP1 EXEC PGM=FIRST_PROGRAM
//FILE1 DD …………
//FILE2 DD ……….
//STEP2 EXEC PGM=SECOND_PROGRAM
//FILE2 DD ………
//OUTFIL DD SYSOUT=*
Job Control Language
JCL is a set of control statements that provide the specifications
necessary to process a JOB. It is the interface between the requirements or instructions in your program and the MVS operating system. Every JOB has three basic JCL statements which are namely:
Without JCL the program will not run on IBM MAINFRAME. So it is like heart of a mainframe.
Following should be followed while writing JCL statement:
- Columns 1-2 should be always //.
- Columns 3-10 are the name field. Must be alpha-numeric and should start with alphabet or character ($, #, @). It is Optional field. It must be followed by at least one blank character.
- Column 12 onwards is the operator field indicating the type of control statement (e.g. JOB, EXEC). Must be preceded and followed by at least one blank.
- The parameter field follows the operator field and must be preceded and followed by at least one blank character. Contains parameter separated by commas.
- To continue a parameter on to the next line, insert a non blank character (typically *) in column 72.
- Comments in JCL begin with //*
Name Operator Parameter
Field Field Field
//SSB5 JOB USER=PRIYA, PASSWORD=XXXXXX
//MYJOB EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD ……
//SYSUT2 DD SYSOUT=A
//* End of JCL Program
In this article let us see the JOB statement in detail
Let us consider the first JCL statement namely the JOB statement. The JOB statement identifies a JOB which is a batch unit of work, to MVS. The JOB statement names the JOB and supplies the necessary information to indicate which resources the JOB will use. A JOB is considered to consist of multiple JOB steps. Each step is made up of an EXEC statement and one or more DD Statements. A JOB is all the JCL statements between a JOB statement and the next JOB statement or null (‘// ‘) statement.
It can be 1-8 characters and the first character must be alphabetic or character ($, #, @)
//ABCDE JOB …………
//BCD$1 JOB ………….
Kinds of parameters
There are two kinds of parameters used in this statement namely
The positional parameters
This parameter has accounting information and programmer name which are explained below:
The Accounting information parameters identify the area that the computer time is to be charged for this JOB. The format of this parameter is installation dependent and it is optional parameter. Parentheses or apostrophes must be used if additional accounting info is coded. Each is separated by commas.
//* S456 is the accounting information. DEPT7 is the additional information.
//SAMP JOB S456
//SAMP JOB (S456,DEPT7)
//SAMP JOB ‘S456,DEPT7’
//SAMP JOB (S456,’DEPT/MIS’,567)
Programmer name parameter is used for user identification
for routing printouts. This can be 1 to 20 characters long and is specified in single quotes if name contains spaces or special characters other than periods. Hyphen cannot be used in this parameter. If you want to include single quotes in the name it must be specified as double quotes
//SAMP1 JOB (bb12,cc34,dd67),‘nam xx’
//SAMP2 JOB (S456), Name5
The keyword parameters
A variety of keyword parameters can be specified on the JOB
statement. They are namely:
The keyword parameters always follow positional parameters and parameter in this is separated by commas.
Let us see how to use the parameters
This indicates the type of JOB submitted to the system. It specifies input class for JOB scheduler. It is a single alphanumeric character namely (a-z, 0-9). Different classes will represent different types of jobs and will depend on installation.
CLASS=A – test jobs
CLASS=B – production jobs
//SAMP1 JOB (S456),CLASS=A
This determines the o/p device to which system messages and JCL messages are written. This is a single alphanumeric character namely A-Z, 0-9. It depends on JES set-up.
MSGCLASS=T – output to terminal
//SAMP2 JOB CLASS=A,MSGCLASS=T
MSGLEVEL parameter is used to specify JCL and allocation messages which will be recorded on the output device specified in MSGCLASS.
MSGCLASS= (statements,messages )
In this statements can take value 0 or 1 or 2. This represents
- 0 Only JOB statement
- 1 All input & procedure statements
- 2 Only input JCL statements
In this messages can take value 0 or 1 or 2. This represents
- 0 Allocation/termination messages being output if the job terminates abnormally.
- 1 Allocation/termination messages being output if the job terminates normally or abnormally.
//SAMP1 JOB (S456),NAM,MSGLEVEL=(0,0)
//SAMP2 JOB (S356), NAM1,MSGLEVEL=(1,1)
This parameter is used for security checking purpose .The user parameter specifies your RACF user id. The user id is used during the job’s processing by RACF and JES to identify the user who submitted the JOB for security checking purposes
//SAMP1 JOB (S456),’SRI PRIYA’,
This Specifies whether a JOB should continue to execute or terminate
in relation to the outcome of any JOB step. If condition is true, the JOB is terminated.
COND= (code, operator)
In this code takes value 0 to 4095 and operator can be any one of GT, GE, EQ, LT, LE, NE
Eg. Cond=(1, EQ) means:
If 1 is equal to the condition code returned by any JOB step, terminate the JOB. In other words, the JOB will execute only if all job steps return a condition code not equal to 1
This parameter specifies the maximum CPU time for a JOB.
System will automatically cancel the JOB if its execution time exceeds the specified time.
E.G. TIME=(2,20) maximum CPU time for this JOB is 2minute and 20 seconds
This has two values namely
- SCAN causes JCL to be scanned for syntax errors only
- HOLD causes JOB to be held in input queue until explicitly released by the operator
This enables the execution of a JOB from a particular step instead from the top of the JOB step.
This determines priority for scheduling jobs within each class and it value ranges from 0-15. The more the number, higher will be the priority.
This specifies amount of space JOB requires and it can be specified in kb or mb
//SAMP5 JOB (S456),’SRI PRIYA’,CLASS=A,PRTY=3,REGION=4092K, TYPRUN=HOLD