EXIT
Syntax
EXIT result| return_code
The EXIT instruction terminates the program with a specified return code, which you can specify in the instruction. The value can be a number or RESULT. You can use this instruction to set a return code, which you can then test, using the JCL COND or IF parameters, to determine which job steps to execute.
Examples:
//SYSIN DD *
* OCL instructions
IF VAR2 = 'KO' THEN EXIT 99
EXIT RESULT
⋮
//*
//TESTIF IF (RC = 99) THEN
//STEP002 EXEC PGM=MYPROG
//…
//TESTIF ENDIF