|
View previous topic :: View next topic
|
| Author |
Message |
Valdis Ozolins
New User
Joined: 09 Dec 2010 Posts: 1 Location: Leeds, West Yorkshire, England
|
|
|
|
In OPC, Is there a way to re run a failed job via a batch process? I have looked at the Control Language (OCL) & the Batch Command Interface Tool but can’t find a way to do this.
[/Search] |
|
| Back to top |
|
 |
KannanChinna
New User
Joined: 14 Feb 2011 Posts: 3 Location: Chennai
|
|
|
|
sjr is the command to rerun a failed job that we see in 5.4 option
R command in 5.2 will be useful to rerun the application from the failed job... |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| What is this? Any job defined in OPC (or TWS) can be rerun. Read the manuals or get a good education. |
|
| Back to top |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Valdis,
dont pm me please. You could have put your pm here :
The question I asked was In OPC, Is there a way to re run a failed job via a BATCH process?
I now you can re run a job from the ISPF interface but this is not what I want. You can also rerun with an OPC RECOVER statement in the JCL but that only gives you one re run and it's instant.
We have some FTP jobs that ocasionaly fail for conection problems & usually a rerun after 2-3 mins works. So I use an MPF exit to trap the failed job and startr an STC to rerun the job in OPC, but there is NO command to do this This is possible on other scheduling platforms.
My response on your pm :
I guess you use system automation (trapping in MPF) if so, you trigger
a rexx in your message table and issue OPCAMOD, OPCAPOST or INGOPC commands within a timer.
see : OPC Automation Programmers Reference" SC33-7046-03
So everybode on this forum can learn from your questions and the answers you get from me and others. |
|
| Back to top |
|
 |
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
This maybe a little late for the OP, but it's really very easy. The OPC RECOVER statement will do exactly what you require.
Firstly, your assertion that the OPC RECOVER statement only gives you one run is not entirely correct. Sure, it will only give you one rerun per RECOVER statement, as obviously you wouldn't want to continuously resubmit a job that was failing. But if you code multiple RECOVER statements, you will get multiple reruns. TWS will comment out one RECOVER statement on each rerun so it is ignored next time.
As for introducing a delay, the easiest way is to use the ADDPROC statement to add a proc containing a delay program in to your JCL. If you don't have a suitable delay program, use the TWS supplied EQQRETWM. You only need to code this on the first RECOVER statement, so the delay proc only gets added once. Alternatively use the ADDAPPL statement to add in a new application that contains a job running on a "wait" work-station which will be a predecessor to your failed job.
And you could if you wanted to rerun the job via your batch started task initiated from the MPF exit triggered by the failure message, but this all seems horribly compliacated. |
|
| Back to top |
|
 |
|
|