test2

Saturday 3 September 2016

Control-M Advance scheduling: Implementing maybe conditions

There are times when we want our job dependencies to consider only the jobs which are loaded and available in Monitoring(AJF).
E.g. We may have daily jobs which are dependent on weekly, or monthly jobs when weekly or monthly jobs are running, on other days daily jobs should run without checking conditions of weekly or monthly jobs.

Fortunately Control-M provides a way to set up such kind of jobs using Maybe conditions:

Steps to implement this:
1. Let's suppose we have Job1, Job2, and Job3
2. Job1 is weekly job and runs on each saturday.
3. Job2 is a monthly job and runs first of each month.
4. Job3 is a daily job which runs everyday.
5. Job 3 waits for weekly and monthly jobs to finish when weekly (Job1) and monthly (Job2) jobs are in AJF.


Such scenario's are implemented using Control-M "ctmldnrs" Utility.

This is how it works:
1. Ctmldnrs scans each jobs's conditions (whenever this utility is run) and finds out pre-req conditions which are not going to be loaded because those jobs are not scheduled to run that day. It creates a default condition file under <control-m server home directory>/ctm_server/ctmldnrs.dat

2. Load the conditions which are not going to be loaded because of jobs not being in ajf, using "ctmldnrs -load"



Creating Job1, Job2, Job3







You can create two jobs and automate it to run every day. Both the jobs will be command jobs and will be running on Control-M server machine. Commands for jobs are.

Condition_Scan_Job
1. ctmldnrs -CALCCOND -ADDMODE NO

Condition_Load_Job
2. ctmldnrs -LOAD "#-*"




Note: Make Condition_Load_Job dependent on Condition_Scan_Job. Schedule Condition_Scan_Job to run immediately after NDP everyday.

So here all the conditions which are set with #- prefix will be loaded if are not available because of job being not available in monitoring(ajf) because of it's scheduling criteria not met.

1 comment: