You have a JCL job with multiple steps, and you want to ensure that Step 2 executes only if Step 1 fails. How would you achieve this using the EXEC statement?

  • Add the COND parameter to Step 2 with a value of 'ONLY IF STEP1 RC > 0'.
  • Set the RETURN-CODE attribute in the EXEC statement of Step 1 to influence Step 2 execution.
  • Use the IF/THEN/ELSE construct in the JCL job to conditionally execute Step 2.
  • Utilize the DEPEND parameter in Step 2, specifying Step 1 as a dependency.
By adding the COND parameter to Step 2, you conditionally execute it based on Step 1's return code, achieving the desired behavior.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *