JCL condition codes are an excellent option in controlling the execution of JCL steps. Total 3 ways we can control the execution of steps.
As we know JCL is powerful language in MVS OS.
The first point is keeping steps only you want in the job. So that those only you can run it.
The second point is giving Condition codes in the step.
//step2 exec pgm=program,cond=(4,GE). This step executes when the condition 4>=RC.step1, fails. similarly you can control execution of steps in the proc. Refer here for more details.
The third point is giving condition in the job.
//jobname job (acctinfo),cond=(4,LE).
for each step it checks cond code in the job. If false then only that step executes.