Recurring Jobs

A recurring job is a batch job that is scheduled to run on a regular basis. With this feature, you do not need to remember when to run necessary requests; you only need to specify the kinds of jobs to run. You define the execution frequency for a batch job. The system then submits the job to the assigned job queue between specified begin- and end-dates. You can define up to 100,000 recurring jobs for each user.

You use the Recurring Job Definition utility (recdef) to define recurring jobs. You access this utility through the Lawson Interface Desktop (LID).

To define and run a recurring job

  1. In the Lawson Interface Desktop (LID), access the Recurring Job Definition utility (recdef).

    From the Batch Job Control menu, choose Recurring Job Definition.

    - or -

    At the command line, type

    recdef

  2. Select the user you are defining recurring jobs for.
  3. For each recurring job that you define, consider the following fields.
    Job Name

    The name of the job you want to run on a recurring basis. The job must already be defined on the Job Definition form or a Lawson batch parameter form.

    The job owner must be the user typed in the User Name field.

    Queue

    The job queue on which you want the recurring job to run.

    This job queue overrides any job queue defaults assigned to a product line or system code on the Job Queue Defaults form.

    Freq

    Select the frequency with which the system is to run the batch job. The options are Half Hr, Hourly, Daily, Weekdays, Weekly, Bi-weekly, Monthly, Endmonth and Annually. The default is Half Hr.

    The Weekdays frequency will schedule jobs to run on Monday through Friday and skip the weekend days of Saturday and Sunday.

    The Bi-weekly frequency will schedule a job to run on the same day of the week two weeks apart, that is, every other week.

    These two options are available for monthly recurring jobs:

    Option Description
    Monthly

    Use this option to run jobs on a specific date in a month.

    For example, if the current date is January 29, 1994 and you type 013094 for the start date, the job runs on January 30, not at all in February, March 30, and so on.

    EndMonth

    Use this option to run jobs on every month end

    For example, if the current date is January 29, 1994 and you type 013194 (which is the month's end) for the start date, the job runs on January 31, February 28 (in a leap year, the job runs on February 29), March 31, and so on.

    Start Date

    The date the job is to start running.

    This date must be greater than or equal to the current date. While the system allows you to type in a date less than the current date, results might be unpredictable.

    Stop Date

    The date the system is to stop running the job. This date must be greater than or equal to the start date.

    If you change the date in the Stop Date field, the system clears out the values in the Next Run Date and Last Run Date fields. This allows you to run a recurring job daily, but change the stop date to Friday's date so the job does not run on the weekend and is not considered as starting late by the Job Scheduler.

    Note:  The system stores recurring jobs on the Recurring Job Definition form until you delete them. The recurring jobs still exist, but the system does not submit them after their stop dates.
    Run Time

    The time the system is to submit the job, in 24-hour time.

    Grace Time

    The time span, from 1 to 99 hours, within which the system must start the job based on the run time.

    A grace time of 99 denotes a job that runs regardless of the elapsed time.

    If the system finds a job whose run time has passed, it checks the elapsed hours and reads the Grace Time field to see whether it should still run this job. If the grace time has passed, the system reads the If Late field to determine the next course of action.

    For example, if you type 0900 in the Run Time field, and 2 in the Grace Time field, the system tries to run the job until 1100. If the job has not started by 1100, the system reads the If Late field to see how it should handle the job.

    If Late

    Select Hold or Next. The default is Hold.

    The If Late field works with the Grace Time field and tells the system what action to take when a job has not started to run within the grace time.

    Hold puts the job on hold and takes no further action. The system stores the job on the Waiting Jobs form with a Hold status and does not run it again until you manually restart it.

    Next bypasses the job for the current run and calculates the next run date. The system stores the job on the Completed Jobs form with a Recurring Job Skipped status and does not run it again until the next scheduled run date.

    Next Run Date

    Display only. The next scheduled run date for the job.

    When you first add a recurring job, and until the job is submitted, this field is blank. Changing the value in the Stop Date field after a job has run causes the system to clear out the value in the Next Run Date field.

    Last Run Date

    Display only. The date the system last ran the job.

    When you first add a recurring job, and until the job is submitted, this field is blank. Changing the value in the Stop Date field after a job has run causes the system to clear out the value in the Last Run Date field.

    The last run date displays even if the system did not actually run the job. That is, if a job was late and put on Hold, or if a job was late and therefore skipped, the Last Run Date field displays the date on which the Hold or Recurring Job Skipped action occurred.

  4. Press OK (Enter) twice to add the recurring job definition.