Jcl-job-statement

提供:Dev Guides
移動先:案内検索

JCL-JOBステートメント

JOBステートメントは、JCLの最初の制御ステートメントです。 これにより、スプールおよびスケジューラーのオペレーティングシステム(OS)にジョブのIDが与えられます。 JOBステートメントのパラメーターは、オペレーティングシステムが適切なスケジューラーを割り当て、CPU時間を必要とし、ユーザーに通知を発行するのに役立ちます。

構文

JCL JOBステートメントの基本構文は次のとおりです。

//Job-name JOB Positional-param, Keyword-param

説明

上記のJOBステートメント構文で使用される用語の説明を見てみましょう。

職種名

これにより、ジョブをOSに送信するときにジョブにIDが付与されます。 長さは1〜8の英数字で、//の直後から始まります。

JOB

これは、JOBステートメントとして識別するためのキーワードです。

位置パラメータ

次の2つのタイプの位置パラメータがあります。

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ステートメントで使用できるさまざまなキーワードパラメーターです。 要件に基づいて1つ以上のパラメーターを使用でき、それらはコンマで区切られます。

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.

CLASSパラメーターの有効な値は、A〜Z文字と0〜9の数字(長さ1)です。 構文は次のとおりです。

  • CLASS = 0〜9
Aから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*

Nは0から15までの数字で、数字が大きいほど優先順位が高くなります。

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"*

ここでは、システムはユーザー「userid」にメッセージを送信しますが、NOTIFY =&SYSUIDを使用すると、メッセージはJCLを送信するユーザーに送信されます。

MSGCLASS

To specify the output destination for the system and Job messages when the job is complete. Following is the syntax:

  • MSGCLASS = CLASS*

CLASSの有効な値は、「A」から「Z」および「0」から「9」です。 MSGCLASS = Yは、JMRにジョブログを送信するクラスとして設定できます(JOBLOG Management and Retrieval:ジョブ統計を保存するためのメインフレーム内のリポジトリ)。

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 =出力ログに書き込まれるステートメントのタイプ

  • ST = 0の場合、ジョブステートメントのみ。
  • ST = 1の場合、JCLとシンボリックパラメーターが展開されます。
  • ST = 2の場合、入力JCLのみ。

MSG =出力ログに書き込まれるメッセージのタイプ。

  • MSG = 0の場合、ジョブの異常終了時に割り当ておよび終了メッセージが書き込まれます。
  • MSG = 1の場合、ジョブ完了の性質に関係なく書き込まれる割り当ておよび終了メッセージ。
TYPRUN

Specifies a special processing for the job. Following is the syntax:

  • TYPRUN =スキャン

ホールド*

SCANおよびHOLDには次の説明があります

  • TYPRUN = SCANは、JCLを実行せずに構文エラーをチェックします。 * TYPRUN = HOLDは、ジョブをジョブキューで保留にします。ジョブをリリースするには、SPOOLのジョブに対して「A」を入力して、ジョブを実行します。
TIME

Specifies the time span to be used by the processor to execute the job. Following is the syntax:

  • TIME =(mm、ss)またはTIME = ss*

ここで、mm =分、ss =秒

このパラメーターは、新しくコーディングされたプログラムをテストする際に役立ちます。 ループエラーのためにプログラムが長時間実行されないようにするために、指定されたCPU時間に達したときにプログラムが異常終了するように、時間パラメーターをコーディングできます。

REGION

Specifies the address space required to run a job step within the job. Following is the syntax:

  • REGION = nK

nM*

ここで、_region_はnKまたはnMとして指定できます。nは数値、Kはキロバイト、Mはメガバイトです。

REGION = 0Kまたは0Mの場合、実行のために最大のアドレス空間が提供されます。重要なアプリケーションでは、アドレス空間の無駄を避けるために0Kまたは0Mのコーディングは禁止されています。

//URMISAMP JOB (*),"tutpoint",CLASS=6,PRTY=10,NOTIFY=&SYSUID,
//  MSGCLASS=X,MSGLEVEL=(1,1),TYPRUN=SCAN,
//  TIME=(3,0),REGION=10K

ここでは、JOBステートメントが行の70番目の位置を超えて拡張されているため、「//」で始まり1つ以上のスペースが続く次の行に進みます。

その他のパラメーター

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.