Initiating Other Jobs

This job initiates several other jobs and programs on a daily basis. The jobs and programs perform routine maintenance tasks such as removing unwanted files, updating other files to the most current version, and setting system options.

?BEGIN JOB DAILY/MAINT;
CLASS=5;
STARTTIME=7:00 ON + 1;
STRING D;
D:=TIMEDATE (MMDDYY);
DISPLAY D;
CASE DECIMAL(D) OF
  BEGIN
    (010190,
    041790,
    052590,
    070390,
    090790,
    112690,
    112790,
    122390,
    122490,
    122590,
    123190):
           ; % TODAY'S A HOLIDAY, NO RUN NEEDED
ELSE:
            BEGIN
              START CLEANUP/FILES;
              START SFA9E/INITIALIZE;
              RUN *SETUP/CANDE/OPTIONS;
              START SFA9E/DAILY/UPDATED;
            END;
   END; START DAILY/MAINT; ?END JOB.  

Explanation

This job only needs to be initiated by an operator once. After that, it reinitiates itself every day. It does this with the START DAILY/MAINT statement at the end of the job. (DAILY/MAINT is the name of the file this job is stored in.) The STARTTIME specification in the job heading causes job initiation to be delayed until 7:00 a.m. on the following day.

The daily maintenance that this job performs is not needed on holidays. Therefore, the TIMEDATE function is used to check the current date, and the date value is assigned to the variable D. The CASE statement compares the value of D with the dates of all the holidays in the year. If D equals any of these dates, the daily maintenance jobs and programs are not initiated.