Skip to content
JCL & batch

COND parameter

The older way of telling a job step whether to run, based on the return codes of earlier steps.

Also written COND, conditional execution

COND controls whether a step runs, by testing the return codes of steps that came before it. It is the traditional mechanism for conditional batch, and it is famous for reading backwards.

The reason is that COND states the condition for skipping a step, not for running it. Written as a comparison and a value, it means "if this test is true, bypass this step". So a test that reads as though it requires a code of four actually skips the step when four is reached. Almost everyone gets this wrong the first several times.

Because of that, modern JCL more often uses IF, THEN and ELSE statements, which express the same logic in the direction you would expect and are considerably easier to read.

You still need to recognise COND, because it appears throughout existing JCL that has been running for decades and will not be rewritten. Reading it correctly is largely a matter of remembering the inversion: the condition describes when the step does not run.

Browse all 115 terms

Learn this properly.

Use COND parameter for real in Mainframe101, in your browser, with Zed beside you. Join the waitlist.

Early access and updates. No spam, unsubscribe any time.