CHAPTER - 10 Control Job Processing in JCL
There are two ways to control job processing in JCL, One way is by coding COND parameter either on JOB or on EXEC, Second way is , using IF condition. In previous chapters, we have discussed about COND parameter on both JOB as well as EXEC.
Now let us discuss about IF condition in JCL Using IF construct is more powerful than COND. - The COND parameter on the first step of a job is ignored However,the IF construct is tested - We can code symbolic parameters in the IF conditions - We can code many types of relational-expressions in IF condition Syntax of IF //name IF < condition > THEN . . //name1 ELSE . . // ENDIF The condition (ralational expression) consists of: Comparison operators Logical operators Not (�) operators Relational expression keywords. Example JCL //EXAMPLE JOB //S1 EXEC MYPROC1 //COND01 IF RC = 0 THEN //C01OK EXEC MYPROC2 //CONDE ELSE //C01ELS EXEC MYPROC3 // ENDIF
EXPLANATION
In above example, S1 is first job step
In 3 rd line, we check the Recturn code of S1 step
if return code is zero then C01OK step will execute
else step C01ELS will going to execute
A Keyword List
Keyword | Purpose |
ABEND | Tests for an abnormal end of a program |
�ABEND | Tests that an abnormal end of a program did not occur |
ABENDCC | Examines an ABEND condition code |
RC | Examines a return code |
RUN | Tests if a job step executed |
�RUN | Tests if a job step did not execute |
Prev Page Next Page