📅  最后修改于: 2020-11-22 17:01:29             🧑  作者: Mango
JOB语句是JCL中的第一个控制语句。这会将作业的标识提供给后台处理程序和调度程序中的操作系统(OS)。 JOB语句中的参数可帮助操作系统分配正确的调度程序,所需的CPU时间并向用户发出通知。
以下是JCL JOB语句的基本语法:
//Job-name JOB Positional-param, Keyword-param
让我们看一下以上JOB语句语法中使用的术语的描述。
在将作业提交给OS时,这将为作业提供一个ID。它的长度可以是1到8(带字母数字字符),并从//后面开始。
这是将其标识为JOB语句的关键字。
有位置参数,可以有两种类型:
Positional Parameter | Description |
---|---|
Account information | This refers to the person or group to which the CPU time is owed. It is set as per the rules of the company owning the mainframes. If it is specified as (*), then it takes the id of the user, who has currently logged into the Mainframe Terminal. |
Programmer name | This identifies the person or group, who is in charge of the JCL. This is not a mandatory parameter and can be replaced by a comma. |
以下是可以在JOB语句中使用的各种关键字参数。您可以根据需求使用一个或多个参数,它们之间用逗号分隔:
Keyword Parameter | Description |
---|---|
CLASS |
Based on the time duration and the number of resources required by the job, companies assign different job classes. These can be visualized as individual schedulers used by the OS to receive the jobs. Placing the jobs in the right scheduler will aid in easy execution of the jobs. Some companies have different classes for jobs in test and production environment. Valid values for CLASS parameter are A to Z characters and 0 to 9 numeric (of length 1). Following is the syntax: CLASS=0 to 9 | A to Z |
PRTY |
To specify the priority of the job within a job class. If this parameter is not specified, then the job is added to the end of the queue in the specified CLASS. Following is the syntax: PRTY=N Where N is a number in between 0 to 15 and higher the number, higher is the priority. |
NOTIFY |
The system sends the success or failure message (Maximum Condition Code) to the user specified in this parameter. Following is the syntax: NOTIFY=”userid | &SYSUID” Here system sends the message to the user “userid” but if we use NOTIFY = &SYSUID, then the message is sent to the user submitting the JCL. |
MSGCLASS |
To specify the output destination for the system and Job messages when the job is complete. Following is the syntax: MSGCLASS=CLASS Valid values of CLASS can be from “A” to “Z” and “0” to “9”. MSGCLASS = Y can be set as a class to send the job log to the JMR (JOBLOG Management and Retrieval: a repository within mainframes to store the job statistics). |
MSGLEVEL |
Specifies the type of messages to be written to the output destination specified in the MSGCLASS. Following is the syntax: MSGLEVEL=(ST, MSG) ST = Type of statements written to output log
MSG = Type of messages written to output log.
|
TYPRUN |
Specifies a special processing for the job. Following is the syntax: TYPRUN = SCAN | HOLD Where SCAN and HOLD has the following description
|
TIME |
Specifies the time span to be used by the processor to execute the job. Following is the syntax: TIME=(mm, ss) or TIME=ss Where mm = minutes and ss = seconds This parameter can be useful while testing a newly coded program. In order to ensure that the program does not run for long because of looping errors, a time parameter can be coded so that the program abends when the specified CPU time is reached. |
REGION |
Specifies the address space required to run a job step within the job. Following is the syntax: REGION=nK | nM Here, region can be specified as nK or nM where n is a number, K is kilobyte and M is Megabyte. When REGION = 0K or 0M, largest address space is provided for execution.In critical applications, coding of 0K or 0M is prohibited to avoid wasting the address space. |
//URMISAMP JOB (*),"tutpoint",CLASS=6,PRTY=10,NOTIFY=&SYSUID,
// MSGCLASS=X,MSGLEVEL=(1,1),TYPRUN=SCAN,
// TIME=(3,0),REGION=10K
在这里,JOB语句正在超出一行的第70个位置,因此我们在下一行继续,该行应以“ //”开头,后跟一个或多个空格。
很少有其他参数可以与JOB语句一起使用,但并不经常使用:
ADDRSPC | Type of storage used: Virtual or Real |
BYTES | Size of data to be written to output log and the action to be taken when the size is exceeded. |
LINES | Maximum number of lines to be printed to output log. |
PAGES | Maximum number of pages to be printed to output log. |
USER | User id used to submit the job |
PASSWORD | Password of the user-id specified in the USER parameter. |
COND and RESTART | These are used in conditional job step processing and are explained in detail while discussing conditional Processing. |