View previous topic :: View next topic
|
Author |
Message |
MainframeCoder
New User
Joined: 12 Jan 2021 Posts: 5 Location: US
|
|
|
|
There is a COND=[4,LT] on the Job Card.
I want to execute a step,
regardless of the return code of ONLY the previous step.
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2 Execute regardless of RC for STEP1
//STEP3 EXEC PGM=PROGRAM3
//STEP4 EXEC PGM=PROGRAM4 Execute regardless of RC for STEP3
Can this be done without having to duplicate the step,
and testing separately for a good vs bad Return Code.
If STEP1 abends, I want STEP2 to execute and the job to end.
If STEP1 and 2 RC LT 4, and STEP3 Abends, execute STEP4. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3077 Location: NYC,USA
|
|
|
|
You set the RC of each step and use IF ENDIF conditions to control the processing. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2154 Location: USA
|
|
|
|
MainframeCoder wrote: |
There is a COND=[4,LT] on the Job Card.
I want to execute a step,
regardless of the return code of ONLY the previous step.
//STEP1 EXEC PGM=PROGRAM1
//STEP2 EXEC PGM=PROGRAM2 Execute regardless of RC for STEP1
//STEP3 EXEC PGM=PROGRAM3
//STEP4 EXEC PGM=PROGRAM4 Execute regardless of RC for STEP3
Can this be done without having to duplicate the step,
and testing separately for a good vs bad Return Code.
If STEP1 abends, I want STEP2 to execute and the job to end.
If STEP1 and 2 RC LT 4, and STEP3 Abends, execute STEP4. |
1. Remove COND= parameters from your JOB and EXEC statements. (BTW, your COND=[...] must give you syntax error)
2. Use appropriate combination of JCL statements
// IF
// ELSE
// ENDIF
It is more flexible, and provides more functionality compared to COND= parameters. |
|
Back to top |
|
|
|