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.
Loading...
Related Quiz
- To skip a step if the return code of the previous step is 4, you would use the COND=_______ syntax.
- What is the difference between the NOTIFY and MSGLEVEL parameters
- To set a condition for the execution of a step, the _______ parameter can be used in the EXEC statement.
- Which JCL statement is used to specify the job class for a job?
- When passing data from one step to another using the EXEC statement, the _______ dataset is commonly used.