In JCL a job can be considered as a unit of work that has to be executed. It contains several JCL statements that instruct the operating system on what to do. In the mainframe environment all the resources required by a program have to be specified. The syntax of the JOB statement is as follows:
//name JOB parameters comments
The following parameters can be specified:
Rules for Coding the JOB Statement
The following must be followed when coding the JOB statement:
The jobname must start in the column 3, immediately following the double slashes. It must be followed by at least one space. This must be the first statement for the particular job being submitted at the time. Valid names can be 1 to 8 alphanumeric characters in length. The national characters (@,# and $) can also be included in the name. The first character can be either an alphabet or a national character, but not a number. Some examples of valid job names are:
More than one job can be submitted in succession within the same JCL. If more than one job are submitted each job should be given a unique job name. If two jobs with the same name are submitted then the second job will be executed only after the termination of the first job.
Positional parameters are parameters that should be specified in the specified order to make any sense. These must precede the keyword parameters where, the order of specification is not important. The JOB statement has two positional parameters: job accounting information parameter and the programmer name parameter.
Accounting information in the mainframe environment is used to bill or charge back any job that is run on the system. The accounting information parameter identifies the account number, which will be billed for the CPU time utilized. The syntax of the accounting information parameter can be any one of the following:
Parentheses or apostrophes must be used if additional accounting information is coded. If only the account number is coded then parentheses or apostrophes can be omitted. If both account number and accounting information are coded a comma should separate them. If only the additional accounting information is coded then the absence of the accounting number should be indicated by placing a comma before the additional accounting information. This is because these are positional parameters and if one parameter is omitted then its absence must be indicated in this way.
If the accounting information parameter contains any special characters, the parameter should be enclosed in single quotes. If the special character is a single quote then it should be preceded by another single quote. Although these parameters are optional as far as the JCL is concerned it may be required by your installation. As far as the contents of these parameters are concerned, you don't have much to do here, there will be installation standards that you must follow, the only thing to remember is to put the comma between each parameter and enclose them within parentheses or apostrophes. Some examples are given below.
The programmer-name parameter follows the job accounting information parameter. It can specify two things:
There are no special syntax requirements for this parameter. Only thing that should be followed is that it should be coded immediately after the accounting information parameter. It can be 1 to 20 characters in length. If the name contains special characters such as a blank, comma, slash, etc. then it should be enclosed in single quotes.
If the name contain a single quote the two single quotes must be used. A hyphen (-) is a special character that cannot be embedded within the programmer name parameter. Some examples are given below.
Keyword parameters must follow the positional parameters, but they can be coded in any order. The following are some of the keyword parameters:
The CLASS Parameter
This parameter assigns what is called a jobclass to a job. A jobclass identifies the nature of the job that is to be submitted. Some job can be executed very fast while others can take long time. Some jobs might be CPU intensive, some other will require one or more tapes and so on. The jobclass is used to identify these characteristics to the operating system, thereby categorizing the job being submitted.
The syntax of the parameter is CLASS=jobclass, where jobclass is any character between A to Z or number between 0 to 9.
In most cases your installation will assign a default jobclass to the CLASS parameter. If this is the case then you need not code it in the JCL You can check with the system administrator for the default jobclass values and the different jobclasses available. Some examples are given below.
The PRTY Parameter
The PRTY is related to the class parameter. It assigns priority to the jobs, which belong to the same class. The syntax of the parameter is PRTY*priority, where priority is a number between 0 to 14 or 0 to 15 depending on which job entry subsystem (JES) is being run at that time.
A job with a higher number takes^ precedence over a job with a lower number. For example, a job with PRTY=12 will be run before a job with PRTY=4. If two jobs have the same PRTY value and the same job class value, then they will be executed in the order in which they are submitted.
In the following examples SEGJ2 will be executed first because, it has a higher priority. In the first case both jobs are of the same class, but in the second example the job classes are different but the second job will be run first because of the higher priority.
The MSGCLASS Parameter
Messages can be categorized into two types:
As a job executes, the operating system outputs messages that specify the events that take place at each step along the way. This includes messages related to the system and those that have to do with the JCL that is being executed. In addition to this, the job that you submit may be executing a program or procedure that writes the output to the printer, a tape or a disk. The MSGCLASS parameter determines the output device to which the system messages and JCL messages are written.
The syntax of the parameter is MSGCLASS=output-class-name, where output-class-name can be any alphabet (A-Z) or number (0-9) character.
The output-class-name is related to a specific output device to which the messages are routed. Some examples are given below.
Example//SEGJl JOB (SEGAWL, SEG), CLASS=A, PRTY=4, MSGCLASS-A> //SEGJ2 JOB 'SEGAWL, SEG', CLASS=C, PRTY=10, MSGCLASS=8
The MSGLEVEL Parameter
The MSGLEVEL parameter is used to specify the JCL and allocation messages, which will be recorded on the output device specified in the MSGCLASS.
As a JCL is submitted, all kinds of messages are generated by the system. These messages can be categorized as follows:
Log messages including jobname, username, etc.
In addition to this, allocation messages are also printed. These messages are printed at the beginning of the job step, indicating the allocation of data sets to devices. They are also printed at the end of the job step, indicating the disposition of the data sets used by the job. The syntax of the parameter can be in any of the following format: MSGLEVEL=(statements, messages) MSCLEVEL=statements MSCLEVEL=(, messages)
In the above syntax, 'statements' may be the number 0, 1 or 2, and messages is a value which can be Oorl.
Coding a value of 0 for statements will result in messages related to the job statement only being output. Coding a value of 1 for statements will result in all JCL statements in the job being output. In addition to this, if any cataloged procedures are invoked their JCL statement will also be printed. If symbolic parameters are used, then they will be also be output, but only after they have been substituted. Coding a 2 will result in only the input JCL statements being printed.
In the message field you can code a 0 or 1. Coding a 0 will result only allocation termination messages being output if the job terminates abnormally. Coding a 1 will result in all allocation termination messages being output, regardless of whether the job terminates normally or abnormally.
The MSGLEVEL parameter should be coded after the positional parameters in the JOB statement. If it is not coded the default will be assumed. The default is all messages being output. This is equivalent to coding MSGLEVEL= (1,1).
The TYPRUN Parameter
The TYPRUN parameter is used to specify a special type of job processing, such as whether a job is to be put on hold, and whether its execution is to suppressed altogether. The syntax of the parameter can be in any of the following format:
Specification of the HOLD parameter will result in the job being held until further notice. This parameter is useful when jobs, which utilize a lot of resources, are required to be held until a time when the system is relatively free. Make sure that the job, which is being held, is ultimately released by the operator, or t will remain in the input queue for a duration of time that is fixed by the installation.
Specifying the SCAN parameter will result in the JCL being scanned for syntax errors and reports them to the requested output media. Syntactical errors are comprised of invalid keywords, illegal characters and incorrect use of parentheses. The job will not be executed when this parameter is used, even if there are no errors. The use of this parameter is a good practice. The NOTIFY Parameter will specify your userid, so that you will be notified when the job is finished.
To send the job completion messages to the person specified in the NOTIFY parameter, MVS uses the ordinary TSO 'send' facility, a crude and limited form of electronic mail!
IBM Mainframe Related Interview Questions
|IBM Lotus Notes Interview Questions||IBM-CICS Interview Questions|
|COBOL Interview Questions||Linux Interview Questions|
|IBM-JCL Interview Questions||IBM Mainframe Interview Questions|
|IBM AIX Interview Questions||IBM WAS Administration Interview Questions|
|IBM Lotus Domino Interview Questions||IBM Integration Bus Interview Questions|
|Mainframe DB2 Interview Questions||Unix Production Support Interview Questions|
Ibm Mainframe Tutorial
Introduction To Software Development
Introduction To Ibm Mainframes
Tso And Ispf
Jes2, ]es3 And Sms
Introduction To Job Control Language (jcl)
The Job Statement
The Exec Statement
The Job And Exec Statements
The Dd Statement
Procedures And Symbolic Parameters
Generation Data Groups (gdg), Compile/link-edit And Run Jcls
Access Method Services (ams)
Additional Vsam Commands
Introduction To Rexx
Overview Of Rexx
Introduction To Cics
Exception Handling In Cics
Developing A Cics Application
Cics Programming Techniques
Basic Mapping Support (bms)
Transient Data Control
Temporary Storage Control
Interval And Task Control
Cics Application Design
Recovery And Restart
System Security And Intersystem Communication
Cics Debugging Facilities And Techniques
Bms Map Definition Macros And Copylib Members
Cics Response And Abend Codes
Data, Information And Information Processing
Introduction To Database Management Systems
Introduction To Relational Database Management Systems
Database Architecture And Data Modeling
Overview Of Db2
Structured Query Language (sql)
Data Security And Access
Db2 Application Development
Qmf And Db2i
Db2 Performance Monitoring, Utilities And Recovery/restart
Overview Of Information Management System (ims)
Introduction To Vs Cobol Ii
Overview Of Application Development In Vs Cobol Ii
Overview Of The Cobol Program
Sorting And Merging Files
Coding Cobol Programs That Run Under Cics. Ims, Db2 And Ispf
Compiling The Program
Link-editing The Program
Executing The Program
Improving Program Performance
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.