Ideally you should not design a job to rerun if it completes successful, since it will continue running until it reaches max rerun limit or run until time.
Control-M does not allow rerunning unless it is set to failed state. Since you set the job to rerun up on successful completion system will set the job to failed state and then rerun. Now you have max rerun set to 0. Hence it will not try rerunning the job and the job remains in failed state. This is the reason why your job remains failed
I am not sure what your design requirement is but you can try changing max rerun value to something higher than 0
Hope this helps you.
My requirement is "Job is to be rerun even if its completed successfully and should be stopped if it gets failed".
and do you know why CONTROL-M does not support rerun on job which is completed successfully?
I have configured email notification on job failure.due to this behavior of CONTROL-M I m getting false notification on mail even though job has ended successfully
waiting for your reply
Logically it is right; you wouldn’t require rerunning a scheduled job if it is completed successfully. However I don’t know what is the exact reason why BMC made it like that. Also I need to check if this is same in the latest versions.
Based on your requirement I would design such a way that the cyclic job runs every minutes or less with From option as “Start” so that the jobs continuously runs. You can also have do stop cyclic if it fails.
1. when we use Do->Rerun option, regardless of job execution status.CONTROL-M will put NOTOK status to the job.
2. If we have to do rerun then we have to use cyclic job option and set maximum rerun parameter value and put ON-->NOTOK | Do-Stop cyclic
Thanks for your help.
That is what my experience teaches me. Glad to know that helped.
1 of 1 people found this helpful
After 5 years of your query BMC had given the cause of it and after 4 years of their justification am replying with that.
The Control-M automatic rerun process functions as follows:
- Control-M determines that automatic rerun is possible only if the job ENDS NOTOK and a specified DO RERUN statement is activated during post-processing. If the monitor determines that automatic rerun is possible, it sets the status of the job to ENDED NOTOK – RERUN NEEDED.
- The monitor then checks the value of MAXRERUN in the Active environment. If the value is zero, automatic rerun is not possible and the job is not submitted for rerun. If the value is greater than zero, rerun is possible and the monitor submits the job for rerun when all runtime criteria are satisfied.
- The JCL for the rerun job is taken from the member specified in the RERUNMEM parameter. If no RERUNMEM value is specified, the JCL for the rerun is taken from the regular JCL member of the job that is specified in the MEMNAME parameter. MAXRERUN applies only to automatic reruns. The MAXRERUN counter is not affected by reruns performed manually using the Rerun option in the Control-M for z/OS Active Environment screen. If a job
is defined as cyclic, the MAXRERUN parameter can be used to specify the number of iterations. This number excludes the initial run of the job.