JOB parameters - IBM Mainframe

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:

  • Accounting information
  • CLASS - Categorization of the job.
  • MSCCLASS - Specification of the output class to job log.
  • MSGLEVEL - Specification of printing the system messages.
  • PRTY - Assignment of priority to a job.
  • TYPERUN - Holding the execution of a job for later execution.
  • NOTIFY - Send messages to the user

Rules for Coding the JOB Statement

The following must be followed when coding the JOB statement:

  1. A valid name must be assigned to the job that is being submitted. The job name must follow the initial two slashes (//) that precede all JCL statements.
  2. The word JOB must be coded after the name before the 16th column.
  3. The positional and key word parameters must be coded. Keyword parameters should not precede the positional parameter. JOBNAME

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

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:

  • (account-number, additional-accounting-information)
  • 'account-number, additional-accounting-information'
  • account-number, additional-accounting-information

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.

Example

Programmer-Name Parameter

The programmer-name parameter follows the job accounting information parameter. It can specify two things:

  • Your name
  • Information related t

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.

Example

Keyword Parameters

Keyword parameters must follow the positional parameters, but they can be coded in any order. The following are some of the keyword parameters:

  • CLASS
  • MSCCLASS
  • PRTY
  • MSCLEVEL
  • TYPRUN

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.

Examples

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.

Example #1


The MSGCLASS Parameter

Messages can be categorized into two types:

  • Messages that relate to the system and the JCL
  • Messages that are output by the program or procedure that is being executed.

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.

  • JCL statements comprising that job
  • Messages related to the execution of the job
  • Output of the program being executed.

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).

Examples

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:

  • TYPRUN = HOLD
  • TYPRUN = SCAN

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!


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics