Run a job Tue-Sat except when Monday a Holiday

All questions about Control-M jobs definitions
Post Reply
User avatar
Meanjean
Nouveau
Nouveau
Posts: 4
Joined: 24 Apr 2008 12:00

Run a job Tue-Sat except when Monday a Holiday

Post by Meanjean » 10 Sep 2011 7:09

A job normally runs TUE-SAT. If Monday is a Holiday, the job should not run on Tuesday. Does anyone know how to make this work?
Thanks!
Jean

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

Post by nicolas_mulot » 12 Sep 2011 2:13

Meanjean,

If you have a controlm mainframe available, you can find a solution based on the CTMBLCAL and CTMRCAL utilities.

CTMBLCAL combines 2 calendars with “plus”, “minus” and “AND” operators, to produced a resulting calendar.
CTMRCAL creates calendars based on the scheduling parameters of the jobs within a scheduling table. It is actually an extension of the forcasting ctmrpln utility, also available on distributed.

Following your example, you could create a calendar of “those Mondays which are not working days” by running a CTMBLCAL which would perform
MONDAY – WORKDAYS = OFFMOND.
You can now define a job which specifies:
DAYS ALL
CONFCAL NOCONFCAL SHIFT +1

This jobs is then orderable on all the days which follow a Monday which is not a working day (which usually are Tuesdays).
Running CTMRCAL against that job will produce a calendar of all Tuesdays following a Monday which is not a working day. Let’s call it AFTMDNW

You can now run a CTMBLCAL which performs TUETOSAT – AFTMDNW will give you the expected result.

Once this is done, you can export your mainframe calendars using exportdefcal, the reload them to distributed aftyer having sed-ed the xml file.

If you don’t have a CTM mainframe, there is no other solution than manually defining such calendars, or developing your own procedures to reach the same result, which I have done.

I still do not understand why these useful utilities have never been re-conducted from mainframe to distributed along the past 20 years.

Cheers
Nicolas_Mulot

User avatar
kaouit
Nouveau
Nouveau
Posts: 1
Joined: 13 Sep 2011 12:00

Post by kaouit » 13 Sep 2011 4:34

Hi !

On scheduling tab in weekdays field : +2,+3,+4,+5,+6,-D1

in calendar field : fill your workday calendar

regards

User avatar
Meanjean
Nouveau
Nouveau
Posts: 4
Joined: 24 Apr 2008 12:00

Run a job Tue-Sat except when Monday a Holiday

Post by Meanjean » 21 Sep 2011 5:05

kaouit and nicolas, thanks for your very helpful responses!

Post Reply