简体   繁体   中英

Control-M add condition between a monthly and a daily job

I'm using control-M for scheduling a few jobs, following is the scenario I face:

Job-1 - Runs daily (not at a specific time)

Job-2 - Ordered on the 1st of every month but runs say around the 10th (not fixed)

Now, I require Job-2 to be dependent on Job-1's execution. Say if job-2 becomes "eligible" for execution on the 12th, then it should only execute in the following scenarios:-

  1. Job-1 for 12th has executed successfully
  2. If job-1's execution is not scheduled for the 12th then Job-2 should check for the last successful execution (ie say maybe the 11th)

Job-2 should not execute if the last execution of Job-1 failed

What I've tried is, specifying the IN condition on Job-2 with date as PREV, but that doesn't seem to check for the current date's job-1 execution.

-->for job-1 use out-condition with "Nodate" -->for job-2 use job-1 Nodate outcondition as in-condition. once this job-2 is ended-ok delete job-1 condition. along with that put an job-2 outcondition with odate. -->in job-1 pre-conditions, check for the (job-1 out-condition with no-date OR job-2 out-condition with prev-date) and delete the conditions after use in pre-requisites only.

Execution flow. so, job-1 will run everyday and throws outcondition with nodate into database. next day when it runs, it checks for the (nodate condition of job-1 OR prev-date out condition of job-2) if any one of them is available, then it accepts that condition and deletes the same condition from database and triggers job-1.

whenever your job-2 is going to run, on that day it will check for the nodate condition of the job-1. if the job-1 is success, then it's nodate outcondition will be available for use and can be used to trigger the job-2. once job-2 is completed, nodate condition of job-1 will be deleted. and current odate outcondition of job-2 will be used in next day job-1 execution as job-1 nodate condition will not be available for use.

Thanks.

There are a few ways to tackle this:

The first would be to have two versions of job 1. The difference between the jobs is in the calandar. One runs all days except the day job 2 is to run. the second only runs on day 2, and this job creates the out condition that job 2 uses as an in conditions.

Another option is to create an out condition as a post process on job 1, then job 2 uses this condition as an in condition with * * as the odate - remember to remove this condition when job 2 completes (which is always a good practice).

syntax is on status = * (or some string in the sysout), compstat = OK, do add condition.

You could also force in job 2 as a post process, add to the on statement do force job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM