View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi,
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
Code: |
//step1 EXEC PGM=IDCAMS,COND=(4,LT)
//SYSIN DD *
SET MAXCC=0
//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)
// END-IF
/ IF (step1.RC = 1) THEN
//STEP5 EXEC PGM=IDCAMS,COND=(4,LT)
//STEP6 EXEC PGM=IEFBR14,COND=(4,LT)
//STEP7 EXEC PGM=IEFBR14,COND=(4,LT)
/ END-IF |
how can we handle this without editing the jcl??
Regds,
useit |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
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. |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
Which Job Scheduler do you use?. |
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
hi,
we use CA7 scheduler
Regds,
useit |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
for jobs under scheduler control most probably the safest way is to use the old COND approach
unless something has changed lately schedulers do not deal well with the IF construct |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
how can we handle this without editing the jcl?? |
And why is that a requirement, what will happen if you edit it? as I believe this is a local unit testing for you and a alternate way of doing it is already mentioned by David? |
|
Back to top |
|
|
|