Control-M cyclic job keeps running even after failure

2.7k views Asked by At

There are 2 cyclic jobs A and B such that A is predecessor to B and A runs after every 2 minutes from end while B runs after every 1 minute from end. Problem is job B keeps on re running and failing even after one failure. I thought on adding 'ON STATEMENT * CODE NOTOK DO STOP CYCLIC ' in steps of job B.

Will this work? If not, what could be the workaround?

2

There are 2 answers

0
Mark On BEST ANSWER

CODE = NOTOK is possibly an issue.

ON/DO using the STATEMENT/CODE combination is usually something like -

ON
STATEMENT = *
CODE = *your literal error string in here*

DO
STOP CYCLIC

e.g. -

ON
STATEMENT = *
CODE = *requested file not file found*

DO
STOP CYCLIC

the CODE = field should be surrounded by asterisks.

0
Abhijit Pritam Dutta On

If you just want to stop the job once it failed use the below statement in your control-M xml file and reload it or else directly add it to your control-m job. If you have other requirement please let us know.

<ON STMT="*" CODE="NOTOK">
   <DOACTION ACTION="SPCYC"/>
</ON>