IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

consideration for restarted jobs:help needed


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Fri Mar 07, 2014 3:39 pm
Reply with quote

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
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Fri Mar 07, 2014 5:17 pm
Reply with quote

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
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Mon Mar 10, 2014 10:34 am
Reply with quote

Which Job Scheduler do you use?.
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Mon Mar 10, 2014 1:58 pm
Reply with quote

hi,
we use CA7 scheduler

Regds,
useit
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10903
Location: italy

PostPosted: Mon Mar 10, 2014 2:29 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3112
Location: NYC,USA

PostPosted: Tue Mar 11, 2014 3:52 am
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Jobs to HELD state JCL & VSAM 3
No new posts Mainframe Storage Needed Mainframe Jobs 0
No new posts purge jobs with return code 0 and ret... JCL & VSAM 6
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
Search our Forums:


Back to Top