Page 4 of 5

Re: TWS job scheduling

PostPosted: Wed Mar 05, 2014 4:18 pm
by Blackthorn
Case code NOAR includes JCL errors, so that is why your first example is not working.

The statement you have for the return code 16 looks ok on the face of it, although it might be useful if you could post the JCL and job output. What happens if you remove the STEPCODE parameter from that job? Is Automatic Recovery then invoked when you get a return code of 16?

Re: TWS job scheduling

PostPosted: Wed Mar 05, 2014 4:31 pm
by apru
Thanks Blackhorn.How to exclude jcl errors from EXCLUDECC??.Will definitely check what you told and get back to you...thanks a ton for clearing my doubts.....

Re: TWS job scheduling

PostPosted: Wed Mar 05, 2014 4:41 pm
by Blackthorn
It depends which errors you do want excluded from Automatic Recovery. The easiest way would be to specify EXCLUDECC=SYST which will point to the other IBM supplied case code module which only includes S222 abends. Otherwise you need to create your own case code module which includes the errors you want excluded.

Read the "Creating case-code-definition modules" section on the Customization & Tuning manual.

Re: TWS job scheduling

PostPosted: Thu Mar 06, 2014 11:26 am
by apru
This is the code in which I tried to implement automatic recovery

// job card
//*%opc recover errstep=step010,stepcode=16,restart=n,addappl=spl
//step010 exec pgm=sort
//sortin dd dsn=id.name
// disp=shr
/sortout dd dsn=id.name2
// disp=shr
//sysprint
//sysout
//sysin
sort fields =( , , , ,)
/*
//

output: -> Job status continues to be in E state
-> NO AUTOMATIC RECOVERY BECAUSE RECOVER STATEMENT DOES NOT MATCH THIS ERROR
******************************************************************************************************************************************************************

Re: TWS job scheduling

PostPosted: Thu Mar 06, 2014 12:02 pm
by apru
One more thing.I have created the application provided in ADDAPPL parameter.The occurrence for this application in current plan will be automatically created by tws when automatic recover statements are executed right???

Re: TWS job scheduling

PostPosted: Thu Mar 06, 2014 6:07 pm
by Blackthorn
I've tried eaxactly the same auto recovery statement and it works for me -

//*>OPC RECOVER ERRSTEP=STEP010,STEPCODE=16,RESTART=N,ADDAPPL=SPL
//* OPC MSG:
//* OPC MSG: I *** R E C O V E R Y A C T I O N S T A K E N ***

I can only suggest that you're not getting a code 16 from your job (what code does TWS show you after it has failed if you browse the job in 5.3?) or you have amended your case code NOAR to include a code 16 which seems unlikely.

And yes, the application you have created will be added to the current plan when the recovery actions are taken.

Re: TWS job scheduling

PostPosted: Fri Mar 07, 2014 9:15 am
by apru
Hi..today morning I attempted the program again..when it ended in error,I used option 5.3.The status of operation is ENDED IN ERROR JCLI...

Re: TWS job scheduling

PostPosted: Fri Mar 07, 2014 2:59 pm
by Blackthorn
That's why your automatic recovery is not working then. You need to fix the cause of your JCLI error.

Re: TWS job scheduling

PostPosted: Wed Mar 12, 2014 12:09 pm
by apru
Hi

Using the option9 in OPC panel (SERVICE FUNC),I deleted the current plan.Then I extended the current plan ,created an application and added an occurrence of the application to the current plan through option 5(MCP).But the application is remaining in waiting state and not getting started.When I asked the scheduling team,they asked me to use the replan option.But I didnt understand the purpose of this...Should any other step be performed after deleting current plan and extending it.????

Re: TWS job scheduling

PostPosted: Wed Mar 12, 2014 1:04 pm
by Blackthorn
Well, for a start you shouldn't need to delete the current plan. You would never do this in a production system and indeed I would be concerned if you even had access to do it. Having said that, if this is a testing system that doesn't run any real work, then you could do that if you wanted to replan the current planning period. But if you've added the schedule in manually all of this is irrelevant, there is no need to do anything else to get the schedule added to the current plan.

If the application is there but it has a status of waiting, you need to determine why this is. What is the status of the first operation? You seem to be trying to run before you can walk - automatic recovery statements and service functions are relatively advanced topics - determining why a application is not running is one of the most basic.