In condition order date problem

All questions about Control-M jobs definitions
Post Reply
User avatar
ayanendu_de
Nouveau
Nouveau
Posts: 11
Joined: 24 May 2007 12:00

In condition order date problem

Post by ayanendu_de » 28 Jan 2014 6:46

I have 2 jobs A and B.

A: runs from Sun-Fri
B: from Mon-Fri

B has incondition of job A of PREV ODAT.

Expectation is that Monday's B will wait for Sunday's A. But that is not happening. Monday's B is waiting for Friday's A as PREV ODAT of B is Friday.

Please suggest a solution.

User avatar
nicolas_mulot
Nouveau
Nouveau
Posts: 149
Joined: 07 Jan 2010 12:00

Post by nicolas_mulot » 05 Feb 2014 11:31

Ayanendu,
This behaviour is normal. When ordering a job, the only information available is the current jobname and the current date. The order function has no way to access information dealing with the predecessors or successors, if any. This is the reason why the keywords PREV, ODAT and NEXT, attached to conditions in the jobs’s definition are resolved according to the current job’s scheduling parameters only. As a consequence, PREV will be resolved at order time depending on the current job’s scheduling parameters, i.e. to the current job’s previous order date.
JOBA_OK PREV specified in JOBB will resolve into JOBB’s previous order date; in your case JOBB’s previous date on Monday is Friday and not Sunday as you expected.
To address this with standard solutions, you may either specify jokers in the dateref of your condition (**** or $$$$ will match any date reference), or use the STAT keyword, which means “regardless the date”. The problem is that you will need to precisely manage tour conditions (i.e. clean them as soon as possible).
For example, if JOBA on Sunday fails, while it finished OK on Saturday, then JOBB on Monday may be triggered by the JOBA_OK condition which has been set on Saturday, which is probably not what you intend. To do so, you will probably need a dummy job that deletes JOBA_OK **** and rune before JOBA, especially on saturdays and Sundays
Cheers
Nicolas Mulot

User avatar
sunuriyal
Nouveau
Nouveau
Posts: 27
Joined: 18 Jan 2014 12:00

Re: In condition order date problem

Post by sunuriyal » 06 Feb 2014 7:07

Hi Ayanendu,

You can create an other instance of job A that runs on Sunday only regardless of In condition and out condition in the CONDITION tab.

As per BMC agreement it will still count 1 instance of job A although you're running two jobs.

I always to try to find out such ways to resolve complected scheduling ;)

Post Reply