i have coded if and else statement inside the job.based on the return code
i will decide whether to invoke existing process or new process
if i set maxcc=1 existing process will be invoked.if i set maxcc=0 new process will be invoked.
During testing I encountered a B37 abend in step step3. Following the restart instructions, I restarted the job at step2 but all the steps flushed because the IF condition is evaluated as false. how can we handle this??
please find the below details
//step1 EXEC PGM=IDCAMS,COND=(4,LT)
//SYSIN DD *
//SYSPRINT DD SYSOUT=*
// IF (step1.RC = 0) THEN
//STEP2 EXEC PGM=IDCAMS,COND=(4,LT)
//STEP3 EXEC PGM=IEFBR14,COND=(4,LT)
//STEP4 EXEC PGM=IEFBR14,COND=(4,LT)
/ IF (step1.RC = 1) THEN
//STEP5 EXEC PGM=IDCAMS,COND=(4,LT)
You can change the IF statement so that it will run in the event that an earlier specified step did not, so you can restart from within a IF/THEN section. The problem in this case is that you'd have to code this on both IF statements and if you restarted from STEP3 it would then also run STEP5 - STEP7.
I would be inclined to redesign your job so that it can be rerun from the top.
Failing that, if you use TWS this can handle this situation for you by manipulating the JES control blocks on a rerun to simulate the return codes from an earlier failed job. Possibly other schedulers have similar features.