Previous Topic: Setting up a job with a predecessor scheduled for the next day

Next Topic: Bypassing non-critical jobs when jobs are late

Providing notification if a job exceeds its maximum execution time

Objective

Send an email message if a particular job runs longer than 2 hours.

Solution

To provide notification if a job exceeds its maximum execution time

  1. Define the job with email notification for the Overdue condition. Customize the email message if you wish.
  2. Use the following JavaScript script at run time for the job to reset the job's Late End time.
    execCommand('%WOB._name','%(APPL._name).%APPL._gen',
     'ACTION RESET LATEEND("now plus 2 hours")');
    

Explanation

When the job is submitted (at run time), the JavaScript script uses the execCommand built-in function to reset the job's end time. The script takes the current time (“now”) and adds the expected execution time of 2 hours.

This solution uses variables for the job name, Application name, and Application generation number to ensure the time for the correct instance of the job is reset.