Control-M : setting job status ok after specified time

4k views Asked by At

I have a control-m file watcher job which waits for a specific file, if file arrived with in specified time job ends ok, but I want to set job status ok when file does not arrived in specified time instead of keep waiting for the file, is this possible ? how to implement it ?

Thank you.

3

There are 3 answers

0
Justin On

There are two ways of setting up a file-watcher.

  1. File Watcher Job
  2. Filewatcher Utility in Control M ctmfw

There are two consequences of FW jobs getting completed.

Giving the out condition to next job, so that the successer jobs start executing

Just to complete the job, so that this gets cleard off in New day process.

Now, if you want 1st consequence, then this is one option - Assume that your FW job [ABC] runs between 0600 - 1800, and the out condition it passes to the successor job is ABC-OK. Successor job [DEF] runs on getting the condition ABC-OK; Keep a dummy job [ABC_DUMMY] which runs on 1805 that sets the same condition ABC-OK. So, once ABC_DUMMY completes, DEF will get the condition it is looking for and will execute.

If the file arrived early, then the FW job ABC will run, and it will set the condition ABC-OK. and DEF will start running. In both this condition, ensure that once DEF is completed, ABC-OK is negated.

If you are looking for second consequence, then I believe as long as job is not failing, FW jobs will be in 'To Run' status, and this will get cleared off in the New Day Process.

Happy to help further. Just post your doubts here.

JN

0
Raja On

Use wait until parameter in file watcher. Suppose if you want the job to watch for the file until 06:00 AM, mention 06:00 AM in wait until parameter mention 06:00.

Exactly at 06:00 AM the job will get fail if it doesn't find the file. then u can use step tab to set the job okay with either of the following options.

  • Option 1:

    ON(ON (Statement=* CODE=COMPSTAT!0))
    DO OK
    

or

  • Option 2:

    ON( (statement=* CODE=NOTOK))
    DO OK
    
0
Dan On

Edit your FileWatcher job

In the EXECUTION tab:

  • Submit between "Enter your beginning time" to "enter your ending time"

In the STEPS tab:

  • ON (Statement=* CODE=COMPSTAT=0)
  • DO OK
  • DO CONDITION, NAME=FILE-FOUND
  • ON (Statement=* CODE=COMPSTAT!0)
  • DO OK
  • DO CONDITION, NAME=FILE-NOT-FOUND