Question

//STE1 IF RC EQ 1 THEN

....

//ENDIF

the return code is giving me FLUSH and all the other job is not executing becaue of this can anyone help me on this. is it because i havent given ELSE?

Was it helpful?

Solution

If you have conditions for running steps, either COND or IF, and the condition determines that a step is not run, then there is no "Return Code" from the step. The step is not run, it is FLUSHed, so there is no RC.

If the rest of the steps in your JOB are expecting to run on a RC=0, then you will have to change something.

Consult the JCL Reference, you have other options, like EVEN, ONLY, but these may not suit (haven't a clue, as don't know exactly what you are trying).

//STEPA 
...
//STEPB
...
//STEPC

If STEPB depends on STEPA, so will not run with a zero RC from STEPA, you need to decide what is needed for STEPC. You have three situations: STEPB not run; runs with zero RC; runs with non-zero RC. What should STEPC do in each case.

If STEPC has no conditional processing, then it will just run whatever happens to STEPB (except an abend, and no EVEN).

If STEPC needs to run conditionally, you have to decide what it is about STEPA and STEPB which tells you how to run it.

If your JOB is big, and the conditions are complex, consider splitting it into separate JOBs and letting the Scheduler take care of it.

If your JCL is destined for Production, there should be JCL Standards to follow, and if you are unclear how to do something, you should consult those responsible for the Production JCL, they will tell you how they want it, and whether you even need be concerned about it (as they may well just re-write from scratch anyway).

OTHER TIPS

When a particular step in a JOB is skipped due to COND parameter or any other reason, what will be the retuen code that will displayed in the spool

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top