无论上一步的 RC 是什么,我都想执行 JCL 步骤?

I want to execute a JCL step no matter what the RC of previous step is?

我的 JCL 中有 3 个步骤:

第 1 步:流程 第 2 步:NDM 第 3 步:在 NDM

之后删除输出

我想完成什么? 不管第2步的return代码是什么,我都想执行第3步。

我试过这个: COND=(16,GT) 和 COND=(16,ST,STEP 2) 但它没有做我想做的事。

在最后一步的 EXEC 语句中尝试 COND=EVEN。

来自文档:

COND=EVEN tells MVS to execute this job step EVEN IF a prior step in the same job abends, unless the job is canceled by the MVS operator.

还有一个 COND=ONLY:

COND=ONLY tells MVS to execute this job step ONLY IF a prior step in the same job abends.

条件说明:

COND 相当违反直觉。描述是:

If none of these tests is satisfied, the system executes the job step; if any test is satisfied, the system skips the job step on which the COND= parameter is coded.

所以你的 COND=(16,GT) 意味着 "If 16 is greater than the return code from any previous steps, don't execute this step"。因此,仅当所有前面的步骤都以 RC > 16 完成时,此步骤才会执行。

COND=(16,ST,STEP 2) 无效 - ST 不是有效条件。有效测试是:

EQ - equal                    
LT - less than                
LE - less than or equal to    
NE - not equal                
GT - greater than             
GE - greater than or equal to 

要执行步骤 运行,无论前面步骤的条件代码是什么,您都可以编写 COND=(0,GT),这意味着“如果 0 大于任何前面的 return 代码(它不会),跳过这一步。'。

为了安全起见,您可以编码:

COND=((0,GT),EVEN)

因为 EVEN 将导致执行此步骤,即使之前的步骤异常终止也是如此。

使用 COND=EVEN 有一个潜在的缺陷,即即使前一步中止,该步骤也会 运行。编码 COND=(0,GT,STEP2) 应该允许 运行 的步骤,但如果有异常终止则不允许。

或者您可以使用 IF/THEN/ELSE/ENDIF 编码。

例如

//STEP2 EXEC PGM=NDM
//IF STEP2.RC >= 0 THEN
//STEP3 EXEC PGM=???
//ENDIF

//STEP2 EXEC PGM=NDM
//IF STEP2.RC GE 0 THEN
//STEP3 EXEC PGM=???
//ENDIF

即可以使用 >=GE

您可能会发现这很有用IF/THEN/ELSE/ENDIF Statement Construct

或 COND 参数 COND Parameter