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.
Loading...
Related Quiz
- You have a JCL job with several job steps, and you want to ensure that a particular step is executed only if the previous step completes successfully. How would you use the PEND statement to achieve this?
- A job you submitted is running longer than expected and consuming excessive CPU time. How would you modify the JCL to limit the job's CPU time?
- How does cataloging a data set in JCL affect its accessibility?
- How does the EXIT statement differ from the PEND statement in JCL?
- In JCL, what is the purpose of the EXEC statement?