Module 2: JCL Structure and Job Card
The JOB Statement
There are three basic functions of JOB statement. Its role is to identify job to Operating system, supply Job name, and supply accounting information (which is used for resource billing). It also supply information that influence the way job is executed and its space limits.
JOB Statement- Format
Let's see the description of the terms used in above Job format.
This indicates the name of the job which will be used to identify job in Spool. You can submit Job with same name multiple times. This filed can be of length 1 to 8 with alphanumeric characters and just starts with //.
In operation field, this keyword is used to indicate that it is JOB card
Positional parameter must precede keyword parameters. Following are two positional parameters for JOB statement:-
- Accounting information:- This positional parameter is used to bill or charge back any job that it runs on the mainframe. This information is used to identify account number which will be charged for the CPU time utilized on mainframe
- Programmer name:- This follows accounting information parameter and not mandatory to specify. This can be used to specify two things:- Programmer’s name or information related to job being submitted
Keyword parameters must follow positional parameters. These parameters can be coded in any order. Let’s see few mostly used keyword parameters:-
- CLASS:- Companies usually assign few classes for Test environment and few classes for Prod environment. This segregation depends on multiple things like time require to execute job, resources used by job.
Syntax: CLASS=jobclassWhere, jobclass is any character between A-Z or number between 0-9.
- MSGCLASS: - Specifies the output class to the Job. This can be used to route messages generated by System/OS during Program execution.
Syntax: MSGCLASS=OUTPUT-CLASS-NAMEWhere OUTPUT-CLASS-NAME can be any alphabetic (A-Z) or numeric (0-9) character.
- MSGLEVEL:- This parameter is used to specify the type of JCL and allocation messages which will be recorded on the o/p device specified in MSGCLASS.
Statement indicates types of statements written to output log
- When statement=0 coded, it will print only Job statements
- When statement=1 coded, it will print Job statements along with symbolic parameter expanded. Also, if catalogued procedure are invoked, then they will also be output.
- When statement=2 coded, it will print only input Job statements
- When message=0 coded, only allocation/termination messages being output if the job terminates abnormally.
- When message=1 coded, No matter whether job ends normally or abnormally, All allocation/termination messages will be sent to output
- PRTY:- It defines priority of Jobs which belong to same class.
Syntax: PRTY=priorityWhere priority is numeric value whose range is between 0 and 15. 0 indicates lowest priority and 15 indicates highest priority
- TYPRUN:- This parameter is used to indicate a special type of job processing, such as whether a job has to be held until it is manually released or only syntax check of job has to be performed without Job execution.
Syntax: TYPRUN=HOLD/SCANWhere functionality of HOLD and SCAN is as described below:-
- TYPRUN=HOLD, this checks the job for syntax error, and if there is any error it is notified and if there is no error it will be held for execution. User have to manually release it for execution by typing ‘A’ as action character against job name in SDSF
- TYPRUN=SCAN, this only checks job for syntax error, without actual execution.
- NOTIFY:- This parameter is used to send and notify message (Job success/failure) to user.
Syntax: NOTIFY=USERIDWhere USERID is the mainframe id of user to whom message about job failure/success should go. If you use &SYSUID, message will be send to user who has submitted Job.
Job statement Example:-