You have a JCL job with two steps: Step 1 and Step 2. You want Step 2 to execute only if Step 1 fails. How would you accomplish this using the IF statement?

  • IF (COND.STEP1 = 0) THEN EXEC Step2
  • IF (RETURN-CODE(STEP1) > 0) THEN EXEC Step2
  • IF (STEP1.RC EQ 0) THEN EXEC Step2
  • IF (STEP1.RC NE 0) THEN EXEC Step2
The correct syntax to execute Step 2 only if Step 1 fails is to use the IF statement with the condition (STEP1.RC NE 0). This checks the return code of Step 1, and if it is not equal to 0 (indicating failure), Step 2 will be executed.
Add your answer
Loading...

Leave a comment

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