|Jol's Scheduling System is
extremely simple to use and written entirely in high level Jol
Code; this allows you to easily make changes to the system to
suit your installation. Using the Scheduling Facility, it is possible
to program job schedules for days, months, or even years in advance.
All your existing jobs can be started without changes. Furthermore, Jol
can be used to schedule your de-bugged and already tested jobs written
in JCL. Full Jol symbolic variable processing is allowed, even
with JCL jobs.
The Jol Schedule Data Set contains various members that can be used to specify which jobs are to run on WORKDAYS, HOLIDAYS, MONDAYS, TUESDAYS, etc., and jobs for particular dates such as JUL12. At a time suitable to you, Jol examines this data set and prepares all the appropriate jobs for execution.
Note: So that you can submit jobs on the day(s) before or after a Holiday, there is prototype code provided in member SPECIAL of the Schedule Data Set.
In general, to specify which jobs are to be started, code the name of the member containing the job in the JOL.SCHEDULE data set using the PREPARE command. For example, to indicate which jobs are to be executed daily is done by coding the names of the jobs in member WORKDAY, as shown below.
Figure 4-1: Indicating Which Jobs are to Run.
The jobs named are submitted for execution on the appropriate days. Jobs may contain any Jol instruction, and include networking instructions. For example, even daily jobs can examine the Jol calender or accept information from the terminal and dynamically alter themselves before submission.
|Jobs in member WORKDAY are submitted on a daily basis. In addition, other members of the library are examined based on dates. The following members of the schedule data set are executed on the appropriate days:|
Figure 4-2: Daily Members Examined by the Schedule Facility.
In addition, the following members of the schedule data set are executed (if present) on the specified days:
Other jobs can be submitted on the last working day, the last day, the last working day -1 and so on. A member called SPECIAL has prototype code for these types of jobs.
Using MONWK01 etc allows you to submit jobs every second week, should you so desire.
Figure 4-4: Week Number and Day Members to be Examined
|Once a day, Jol examines the
Schedule data set. If it is not a holiday, it examines the WORKDAY
member; if it is Saturday or Sunday, the data in these members is used
instead, otherwise member HOLIDAY is used. Additionally, any
other member such as JUL14 is also examined, if appropriate.
/* This is the normal WORKDAY member of the JOL.SCHEDULEIt is examined on WORKING DAYS ONLY.
You may put in other Jol commands before you use the
PREPARE verb to prepare your work for submission.
See the example below for 'SPEC'.
Prepare DAILYBU; /* Prepare Daily Backup Job */
PREPARE INVOICES; /* Prepare Daily INVOICE Job */
if %day='TUESDAY' /* If today is TUESDAY */
then prepare SPEC; /* then prepare a SPEC job */
Figure 4-5: Sample WEEKDAY Jobs
|The ability to automatically submit
jobs on every WORKDAY, MONDAY or even on ODD or
EVEN weeks etc is highly flexible. However, sometimes you
also need to be able to submit work on the day before a HOLIDAY,
WORKDAY and so on. One way to do this is to
place your PREPARE commands in the appropriate position in the SPECIAL
member of the Jol Schedule file.
Before the SPECIAL file is examined, an array is set up so that you can easily determine if today, tomorrow, or today plus three days is a Holiday, or a Work Day. In addition to all the usual Jol Calendar Variables such as %DAY, %DAYNO, %MONTH etc, another variable called %LASTDAY contains the number of days in the current month. %LASTDAY is correct for Leap Years.
Using Jol programming language and the variables above makes special coding requirements easy to cater for.
The following page shows some of the coding that you may do in the SPECIAL file.
Tomorrow is a Holiday
The day after tomorrow is a Holiday
The day after tomorrow is the last WORKDAY
The day after that
is the last WORKDAY
It is examined every day, and can test if TOMORROW is a 00030000
Holiday, or yesterday and so on. See the examples below. */ 00040000
if %holiday='YES' 00060000
then do; 00070000
write 'We could PREPARE a job here'; 00080000
/* See if the next few days are HOLIDAYS */ 00110000
if %holiday='NO' 00130000
then do; 00140000
if %list(%dayno+1)='HOL' 00150000
then do; /* TOMORROW is a Holiday */ 00160000
write 'We could PREPARE a job here'; 00170000
PREPARE tomorrow; 00180000
PREPARE B ; 00190000
if %list(%dayno+2)='HOL' 00210000
then do; /* The NEXT day is a Holiday */ 00220000
write 'We could PREPARE a job here'; 00230000
if %list(%dayno+3)='HOL' 00250000
then do; /* and +3 day is a Holiday */ 00260000
write 'We could PREPARE a job here'; 00270000
if %list(%dayno-1)='HOL' 00290000
then do; /* YESTERDAY was a Holiday */ 00300000
write 'We could PREPARE a job here'; 00310000
/* Sample ONLY:- See if Yesterday was a Holiday, and Today is a 00350000
Workday. */ 00360000
if %list(%dayno-1)='HOL' /* Was YESTERDAY a Holiday */ 00380000
& %list(%dayno)='WORK' /* and TODAY a WORKDAY ? */ 00390000
then do; 00400000
write 'We could PREPARE a job here for Yesterday''s Holiday'; 00410000
PREPARE yesthol; 00420000
PREPARE B ; 00430000
/* See if the next few days are the END OF MONTH */ 00460000
if %holiday='NO' 00480000
then do; 00490000
%work=%dayno+1; /* Set WORK to TOMORROW */ 00500000
if %work=%lastday then do; /* TOMORROW is the LAST */ 00510000
DAY of the month */ 00520000
write 'We could PREPARE a job here'; 00530000
PREPARE B ; 00540000
%work=%work+1; /* Check the NEXT Day */ 00560000
if %work=%lastday then do; /* The NEXT day is the */ 00570000
LAST DAY of the month */ 00580000
write 'We could PREPARE a job here'; 00590000
PREPARE B ; 00600000
%work=%work+1; /* Check the Day AFTER that */ 00620000
if %work=%lastday then do; /* The NEXT day(+3) is the */ 00630000
LAST DAY of the month */ 00640000
write 'We could PREPARE a job here'; 00650000
PREPARE B ; 00660000
Figure 4-6: Sample SPECIAL File.
|The Scheduling System uses Jol's
automatic Calendar facility to determine if the day of the week is a
Saturday or Sunday, and automatically submits any jobs for the
However, Jol does not know which days are holidays in your country for any given year, or which other days in your organization are holidays for special reasons such as a nine day fortnight instead of the more usual ten day fortnight.
So that the Jol Scheduling System can determine which days are Holidays, Rostered Days Off and so on, you code these special days in a member called HOLS1988, HOLS1989 etc. The format is as the example for HOLS1987 shown below:
JAN 1 /* AUSTRALIAN HOLIDAYS */ 00010000
JAN 1 /* NEW YEAR'S DAY */ 00020000
JAN 26 /* AUSTRALIA DAY */ 00030000
APR 17 /* GOOD FRIDAY */ 00040000
APR 18 /* EASTER SATURDAY */ 00050000
APR 19 /* EASTER SUNDAY */ 00060000
APR 20 /* EASTER MONDAY */ 00070000
APR 25 /* ANZAC DAY */ 00080000
JUN 8 /* QUEENS BIRTHDAY */ 00090000
DEC 25 /* CHRISTMAS DAY */ 00100000
DEC 26 /* BOXING DAY */ 00110000
As you can see in the example above, you code the the first three characters of the month, followed by at least one space and any optional comments. Note that each day must be on a separate line.
Because Jol uses the year as part of the member name, you can set up holidays for years in advance.
|Additionally, Jol allows: