EXEC语句中的一些参数
EXEC语句有两个位置参数,PGM和PROC,每条EXEC语句必须有且仅有其中一个
一、ACCT参数
表明作业步所需的USER-ID,记账信息是子参数最多不可超过142个,
// STP3 EXEC PROC=LOOKUP,ACCT=('/8346')
二、ADDRSPC和REGION
2.1 ADDRSPC,表明作业所需的存储类型
默认参数是VIRT,作业请求虚拟页式存储;REAL表明作业请求实存空间,不能进行页式存储
//CAC1 EXEC PGM=1,ADDRSPC=VIRT
//CAC2 EXEC PROC=B,ADDRSPC=REAL,REGION=100K
2.2 REGION,表明作业步所需要存储空间大小
指定作业步骤,需要的存储空间大小,因为存储空间特别的贵,搞不好就让你查REGION的数量去了
//MKBOYLE EXEC PROC=A,REGION=100K,ADDRSPC=REAL
//* 这个全局都能用
//STEP6 EXEC PGM=CONT,REGION=250K
//*只能作业步内用
三、TIME参数
//STEP1 EXEC PGM=READER,TIME=1
//STEP2 EXEC PGM=WRITER
STEP1规定了一分钟的执行时间,STEP2的执行时间由STEP1决定,即STEP2的执行时间=1分钟-STEP2实际运行时间
陪伴是最长情的告白,JCL的运行时间中同样也是这样,因为JCL是在处理排队中作业的一种脚本语言
在JOB语句中不能设置TIME=0,在EXEC语句中可以,TIME=0的含义是,本作业步的执行时间,由前作业步的剩余执行时间决定
四、COND参数
GT,大于;GE大于等于;EQ,等于;NE,不等于
4.1 EVEN(即使)参数
Specifies that this job step is to be executed even if a preceding job step abnormally terminated. When EVEN is coded, the system:
- Does not test the return code of any steps that terminated abnormally.
- Does test the return code of any steps that terminated normally. If none of the return code tests for these steps is satisfied, this job step is executed.
参考翻译:
指定即使 前面的作业步骤异常终止。对 EVEN 进行编码时,系统:
-
不测试先前任何异常终止STEP的返回代码。
-
测试正常终止STEP返回代码。如果没有CODE满足这些步骤的测试条件,将执行此job step。
4.2 ONLY(只有)参数
Specifies that this job step is to be executed only if a preceding step abnormally terminated. When ONLY is coded, the system:
-
Does not test the return code of any steps that terminated abnormally.
-
Does test the return code of any steps that terminated normally. If none of the return code tests for these steps is satisfied, this job step is executed.
参考翻译:
指定仅当 前一步异常终止。当 ONLY 被编码时,系统: -
不测试任何异常终止的STEP的返回代码。
-
测试正常终止的任何步骤的返回代码。如果没有返回代码 满足这些步骤的测试,将执行此作业步骤。
4.3 一些例子
Example 1:*
//STEP6 EXEC PGM=DISKUTIL,COND=(4,GT,STEP3)
In this example, if the return code from STEP3 is 0 through 3, the system bypasses STEP6. If the return code is 4 or greater, the system executes STEP6. Because neither EVEN nor ONLY is specified, the system does not execute this step if a preceding step abnormally terminates.
如果STEP3的值小于4,那么不执行STEP6,由于没有设置EVEN或者ONLY,如果先前的作业步异常终止,系统不会执行此作业步
*Example 2:*
//TEST2 EXEC PGM=DUMPINT,COND=((16,GE),(90,LE,STEP1),ONLY)
The system executes this step ONLY if two conditions are met:
只有在下面两种情况下才能运行
- A preceding job step abnormally terminated.
- No return code tests are satisfied.
Therefore, the system executes this step only when all three of the following are true:
- A preceding job step abnormally terminated.
- 先前作业步异常终止
- The return codes from all preceding steps are 17 or greater.
- 所有先前作业的返回码大于等于17
- The return code from STEP1 is 89 or less.
- STEP1的返回码小于等于89
The system bypasses this step if any one of the following is true:
-
All preceding job steps terminated normally.
-
The return code from any preceding step is 0 through 16.
-
The return code from STEP1 is 90 or greater.
*Example 3:*
//STEP1 EXEC PGM=CINDY
.
.
//STEP2 EXEC PGM=NEXT,COND=(4,EQ,STEP1)
.
.
//STEP3 EXEC PGM=LAST,COND=((8,LT,STEP1),(8,GT,STEP2))
.
In this example, if STEP1 returns a code of 4, STEP2 is bypassed. Before STEP3 is executed, the system performs the first return code test. If 8 is less than the return code from STEP1, STEP3 is bypassed; or, restated, if the STEP1 return code is less than or equal to 8, STEP3 is executed. Because 4 is less than 8, STEP3 is executed.
在此示例中,如果 STEP1 返回代码 4,则绕过 STEP2。 在执行 STEP3 之前,系统会执行第一个返回码 测试。如果 8 小于 STEP1 的返回码,则绕过 STEP3; 或者,如果 STEP1 返回代码小于或等于 8, 执行 STEP3。由于 4 小于 8,因此执行 STEP3。
The system does not perform the second return code test because STEP2 was bypassed.
*Example 4:*
//STP4 EXEC PROC=BILLING,COND.PAID=((20,LT),EVEN),
// COND.LATE=(60,GT,FIND),
// COND.BILL=((20,GE),(30,LT,CHGE))
This statement calls cataloged or in-stream procedure BILLING. The statement specifies different return code tests for each of the procedure steps: PAID, LATE, and BILL. The system executes step PAID even if a preceding step abnormally terminates unless the accompanying return code is satisfied.
EXEC语句调用了过程 BILLING。 该语句为procedure steps:PAID、LATE 和 BILL测试返回值。除非返回代码满足测试条件,即使先前作业步异常终止,过程步PAID都将被执行