Jcl-exec-statement

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

JCL-EXECステートメント

各JCLは、多くのジョブステップで構成できます。 各ジョブステップは、プログラムを直接実行するか、1つ以上のプログラム(ジョブステップ)を順番に実行するプロシージャを呼び出すことができます。 ジョブステップのプログラム/手順情報を保持するステートメントは、* EXECステートメントです。*

EXECステートメントの目的は、ジョブステップで実行されるプログラム/手順に必要な情報を提供することです。 このステートメントでコーディングされたパラメーターは、実行中のプログラムにデータを渡し、JOBステートメントの特定のパラメーターをオーバーライドし、EXECステートメントがプログラムを直接実行する代わりにプロシージャーを呼び出す場合、パラメーターをプロシージャーに渡すことができます。

構文

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

//Step-name EXEC Positional-param, Keyword-param

説明

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

STEP-NAME

これにより、JCL内のジョブステップが識別されます。 長さは1〜8で、英数字を使用できます。

EXEC

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

定位置パラメーター

これらは定位置パラメーターであり、2つのタイプがあります。

Positional Parameter Description
PGM This refers to the program name to be executed in the job step.
PROC This refers to the procedure name to be executed in the job step. We will discuss it a separate chapter.

KEYWORD-PARAM

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

Keyword Parameter Description
PARM

Used to provide parametrized data to the program that is being executed in the job step. This is a program dependant field and do not have definite rules, except that the PARM value has to be included within quotation in the event of having special characters.

以下の例では、値「CUST1000」が英数字値としてプログラムに渡されます。 プログラムがCOBOLの場合、JCLのPARMパラメーターを介して渡された値は、プログラムのLINKAGE SECTIONで受信されます。

ADDRSPC

This is used to specify whether the job step require virtual or real storage for execution. Virtual storage is pageable whereas real storage is not and is placed in the main memory for execution. Job steps, which require faster execution can be placed in real storage. Following is the syntax:

  • ADDRSPC = VIRT

リアル*

ADDRSPCがコーディングされていない場合、VIRTがデフォルトです。

ACCT

EXECおよびJOBステートメントの共通キーワードパラメーター

Keyword Parameter Description
ADDRSPC ADDRSPC coded in JOB statement overrides the ADDRSPC coded in EXEC statement of any job step.
TIME If TIME is coded in an EXEC statement, then it applies to that job step only. If it is specified in both JOB and EXEC statement, then both will be in effect and can cause time-out error due to either of it. It is not recommended to use TIME parameter in both the JOB and EXEC statement together.
REGION

If REGION is coded in an EXEC statement, then it applies to that job step only.

JOBステートメントでコーディングされたREGIONは、ジョブステップのEXECステートメントでコーディングされたREGIONをオーバーライドします。

COND

Used to control the job step execution based on the return-code of the previous step.

CONDパラメーターがジョブステップのEXECステートメントでコーディングされている場合、JOBステートメントのCONDパラメーター(存在する場合)は無視されます。 CONDパラメーターを使用して実行できるさまざまなテストについては、条件付き処理で説明しています。

以下は、JCLスクリプトの簡単な例とJOBおよびEXECステートメントです。

//TTYYSAMP JOB 'TUTO',CLASS=6,MSGCLASS=X,REGION=8K,
//     NOTIFY=&SYSUID
//*
//STEP010 EXEC PGM=MYCOBOL,PARAM=CUST1000,
//     ACCT=(XXXX),REGION=8K,ADDRSPC=REAL,TIME=1440