Job Control Language (JCL)
May 3, 2011 | Posted by: admin | IBM, Programming language | 3 Comments
Job Control Language (JCL) is a scripting language used on IBM mainframe operating systems to instruct the system on how to run a batch job or start a subsystem. There are actually two IBM JCLs: one for the operating system lineage that begins with DOS/360 and whose latest member is z/VSE; and the other for the lineage from OS/360 to z/OS.
General JCL Rules.
- Must begin with // (except for the /* statement) in columns 1 and 2
- Is case-sensitive (lower-case is just not permitted)
- NAME field is optional
- Must begin in column 3 if used
- Must code one or more blanks if omitted
- OPERATION field must begin on or before column 16
- OPERATION field stands alone
- OPERANDS must end before column 72
- OPERANDS are separated by commas
- All fields, except for the operands, must be separated by one blank.
The Job Statement.
Every JCL member (or JOB) you write will require a JOB statement (or JOB card) to identify the job. This must be the first statement in each job. Since the JOB card is a JCL statement it must start with a ‘//’ (two slashes) in positions 1-2. The following is a sample JOB statement.
//SIMOJOB1 JOB (ACCTINFO),’comment’,CLASS=A,MSGCLASS=0,
// MSGLEVEL=(1,1),NOTIFY=USERID
The job name should be in positions 3-n (for a maximum of eight characters) followed by a space.
The job name is specified first, in this example the job name will be SIMOJOB1. The key-word JOB is specified to indicate this is the JOB statement or Job Card.
The (ACCTINFO) is accounting information and is a required. This may be an accounting cost center. The cost center information varies from site to site and may be used to do charge-backs to individual departments for usage of the system.
The ‘comment’ is an identifying or explanatory field. It is optional but can very useful. It ha a 20 characters maximum length.
The job class is specified by using “CLASS=” key word. This information is used to tell the system how the job is to be run. Jobs will be scheduled and will run under control of a predefined class as determined by the job initiator. The job class may determine the priority of the job and how long it will be allowed to run. If the job initiator is already running a job then the current job request may be placed in a job queue and have to wait until the initiator is free.
The MSGCLASS=x is used to specify where the job output will be directed. The output classes are predefined and vary from site to site. Two are the normal defaults are as follows.
A = Normal system printing and all output listings sent to the default system printer.
0 = Hold output in the queue and allow job output to be viewed on-line through the TSO outlist facility.
The MSGLEVEL=(x,y) is used as follows.
x
0 = The system prints only the JOB statement.
1 = The system prints all JCL statements, JES2, or JES3 control statements, the procedure statements, and IEF653I messages which show the values assigned to symbolic parameters in procedure statements.
2 = The system prints only JCL statements and JES2 and JES3 control statements.
y
0 = The system prints only JCL messages. It prints JES and operator messages only if the job abnormally terminates.
1 = The system prints JCL messages and any JES and operator messages.
If you want to be notified when the job has finished then use the “NOTIFY=” key word. The NOTIFY parameter must specify a valid userid.
Three types of JCL statements.
JOB Identifies the beginning of a job
EXEC Indicates what work is to be done
DD Data Definition, i.e., Identifies what resources are needed and where to find them
JCL Comment Statement.
A comment statement is defined by a “//*” in positions 1-3. The following is an example of a JCL comment statement.
//* THIS IS A JCL COMMENT STATEMENT…
Exec statement.
Use the EXEC (execute) statement to identify the application program or cataloged or in-stream procedure that this job is to execute and to tell the system how to process the job.
//stepname EXEC procedure,REGION=####K
or
//stepname EXEC PGM=program,REGION=####K
stepname – an optional 1 to 8 character word used to identify the step
EXEC – indicates that you want to invoke a program or cataloged procedure
procedure – name of the cataloged procedure to be executed
program – name of the program to be executed
REGION=####K – amount of storage to allocate to the job
Comments (3)
hey there and thank you for your info – I’ve certainly picked up something new from right here. I did however expertise some technical issues using this website, since I experienced to reload the site many times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and can damage your high-quality score if ads and marketing with Adwords. Well I’m adding this RSS to my email and can look out for a lot more of your respective intriguing content. Make sure you update this again very soon..
Really enjoyed reading that.
Respected Sir,
Good evening.How are you? Hope you feel better.Prayers for your speedy recovery.How’s Abhishek ji.