jcl - jcl 中的刷新步骤返回码

标签 jcl return-code

我遇到了以下场景,我对 cond 参数如何在前面的步骤中起作用有点困惑,这是 flsuhed 出来的。

比如……

//第一步执行
//步骤 2 执行条件=(0,ne,step1)
//步骤 3 执行条件=(0,ne,step2)

在上述情况下,对于一个输入文件,step1 RC 为 4,因此 Step2 被清除,但已执行第 3 步。
这是我感到困惑的地方,jcl 会将刷新的步骤 rc 视为 0 还是导致 step3 执行的原因,即使 step2 未执行。

感谢任何关于此的解释,并提前致谢。

最佳答案

来自documentation ...

Use the COND parameter to test return codes from previous job steps and determine whether to bypass this job step. You can specify one or more tests on the COND parameter, and you can test return codes from particular job steps or from every job step that has completed processing. If any of the test conditions are satisfied, the system evaluates the COND parameter as true and bypasses the job step. If none of the test conditions specified on the COND parameter are satisfied, the system evaluates the COND parameter as false and executes the job step.

The system performs the COND parameter tests against return codes from the current execution of the job. If a test returns a previously bypassed step, the system evaluates the test as false.

请注意我用斜体显示的文字。因为“系统将测试评估为错误”,所以执行了作业步骤。换句话说,EXEC 语句的 COND 参数按记录工作。至于为什么这个参数被设计成这样工作,恐怕在大约 40 多年前它被发明的时候我并没有在这个领域工作,因此无法说明原始的推理开发人员。

您可能想查看 IF statement ,除了测试其返回代码外,它还提供测试给定步骤是否已运行的功能。

//STEP01 EXEC 
//CK01   IF STEP1.RC EQ 0 THEN
//STEP02 EXEC
//CK01E  ENDIF
//CK02   IF STEP2.RUN & STEP2.RC EQ 0
//STEP03 EXEC
//CK02E  ENDIF

或者,您可以编写代码...

//STEP01 EXEC 
//CK01   IF STEP1.RC EQ 0 THEN
//STEP02 EXEC
//CK02   IF STEP2.RC EQ 0
//STEP03 EXEC
//CK02E  ENDIF
//CK01E  ENDIF

关于jcl - jcl 中的刷新步骤返回码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9840691/

相关文章:

COBOL:SYSIN JCL,用于从 PDS 编译源代码

mainframe - 如果在步骤 2 中创建了一代并且在步骤 3 中引用了相同的内容,如何引用 GDG 生成

c - 在 C 中实现错误传播的正确方法是什么?

winapi - 当进程不再存在时,GetExitCodeProcess 如何获取退出代码

shell:在两个不同的变量中捕获命令输出并返回状态

KSH shell 脚本不会执行并返回 127(未找到)

mainframe - 主机 JCL 中的 DPRTY 是什么?

mainframe - 什么是 MVS 和 JCL?

jcl - 作业的 SYSOUT 和 SYSPRINT 之间有什么区别?

c - 混合 bool 和 ret 代码是个坏主意吗