Managing external follows dependencies for jobs and job streams
- Same day
- Considering
the job or job stream instances planned to run on the same day. In
this case you set the clause follows...sameday in the
object definition. Figure 1 shows
a job stream named Js1 which has an external follows
dependency on the instance of the job stream Js2 that
is scheduled to start on the same day. Figure 1. Sameday matching criteriaBelow is an example of how to define the involved job streams.
The job stream Js1 in not launched until the job stream instance of Js2 on the workstation wk1 completes successfully.schedule Js2 schedule Js1 on everyday on everyday at 0700 at 1000 :job2 follows wk1#Js2 sameday end :job1 end - Closest preceding
- Using
the closest job or job stream instance (earlier or same time). The
job or job stream instance that HCL Workload Automation uses
to resolve the dependency is the closest in time before the instance
that includes the dependency. In this case you set the follows
... previous clause in the object definition. Figure 2 shows a job stream named Js1 which
has an external follows dependency on the closest earlier instance
of job stream Js2. The time frame where the predecessor
is searched is greyed out in the figure. Figure 2. Closest preceding matching criteriaBelow is an example of how to define the involved job streams.
The job stream Js1 in not launched until the closest preceding job stream instance of Js2 on the workstation wk1 completes successfully.schedule Js2 schedule Js1 on Th on Fr at 0700 at 1000 :job2 follows wk1#Js2 previous end :job1 end - Within a relative interval
- Considering the job or job stream
instances defined in a range with an offset relative to the start
time of the dependent job or job stream. For example, from 25 hours
before the dependent job stream start time to 5 hours after the dependent
job stream start time. In this case you set the follows ... relative
from ... to ... clause in the object definition. Figure 3 shows a job stream named Js1 which
has an external follows dependency on the job stream instance of Js2 that
starts with an offset of 2 hours with respect to Js1.
The job or job stream instance that HCL Workload Automation considers
to resolve the dependency is the closest one within the relative time
interval you chose. Figure 3. Within a relative interval matching criteriaBelow is an example of how to define the involved job streams.
The job stream Js1 in not launched until the job stream instance of Js2 on the workstation wk1 that runs in the 08:00 to 12:00 time frame completes successfully.schedule Js2 schedule Js1 on everyday on everyday at 0900 at 1000 :job2 follows wk1#Js2 relative from 0200 to 0200 end :job1 end - Within an absolute interval
- Using only the job or job stream instances defined in a range. For
example from today at 6:00 a.m. to the day after tomorrow at 5:59 a.m. In this case you set the
follows ... from ... to ... clause in the object definition. Figure 4 shows a job stream named Js2
which has an external follows dependency on the instance
of job stream Js1
that is positioned in the preproduction plan between 7
a.m. and 9 a.m. The job or job stream instance that HCL Workload Automation considers to resolve the dependency is
the closest one within the absolute time interval you chose. The time interval specifies the time of
the day on which the interval starts and ends, either on the same day as the instance that include
the dependency or on a day defined relative to that day.Figure 4. Within an absolute interval matching criteriaBelow is an example of how to define the involved job streams.
The job stream Js2 in not launched until the job stream instance of Js1 on the workstation wk1 that runs in the 07:00 to 09:00 time frame on the same day completes successfully.schedule Js1 schedule Js2 on everyday on everyday at 0800 at 1000 :job1 follows wk1#Js1 from 0700 to 0900 end :job2 end
- HCL Workload Automation searches for the closest instance that precedes the depending job or job stream start time. If such an instance exists, this is the predecessor instance.
- If there is no preceding instance, HCL Workload Automation considers the correct predecessor instance as the closest instance that starts after the depending job or job stream start time.
External follows dependencies are identified between jobs and job streams stored in the database whose instances are added to the preproduction plan when the preproduction plan is automatically created or extended. Job and job stream instances submitted in production from the conman command line are written in the preproduction plan but they are not used to recalculate predecessors of external follows dependencies already resolved in the preproduction plan.
The scheduler classifies follows dependencies as internal when they are specified only by their job name within the job stream. It classifies them as external when they are specified in the jobStreamName.workstationName.jobName format.
When a job stream includes a job with a follows dependency that shares the same job stream name (for example, job stream schedA includes a job named job6 that has a follows dependency on schedA.job2), the dependency is added to the plan as an external follows dependency. Since Version 8.3, unlike in previous versions, because the scheduler uses the sameday matching criteria to resolve external dependencies, dependencies originated in this way are never added the first time the object is submitted.
- If the successor is carried forward when the production plan is extended, the predecessor is included in the new production plan and the dependency becomes current. A pending predecessor job or job stream is marked with a [P] in the Dependencies column in the output of the conman showjobs and conman showschedules commands.
- If the successor is not carried forward when the production plan is extended, the predecessor is included in the new production plan, but the dependency becomes orphaned. This can happen, for example, if, when extending the production plan, the successor is carried forward and the pending predecessor is not added to the plan because it was flagged as draft in the database. The orphaned dependencies are marked with a [O] in the Dependencies column in the output of the conman showjobs command. When dealing with an orphaned dependency you must verify if it can be released and, if so, cancel it.
Note that when an HCL Workload Automation network includes agents running on IBMIBM® Workload Scheduler versions older than 8.3 and the enLegacyId option is set to yes on the master domain manager, having multiple instances of a job stream as pending predecessors produces errors caused by identification problems at submission time.
External follows dependency resolution and status transition examples
This section includes examples for each of the four matching criteria described in the previous paragraphs. In all the examples, the start of day time (SOD) is set to 06:00 AM.
- Same day
- The job or job stream instance to be considered in resolving the dependency is the closest one on the same day in which the instance that includes the dependency is scheduled to run. In this example, two job streams, Js1 and Js2, each have one job. Job stream Js1 is scheduled to run every day at 08:00 and on Thursdays also at 07:00. Js1.Job1 runs at 09:00. Job stream Js2 has no time restrictions and is scheduled by default at the defined start of day time. Js2.Job2 is scheduled to run at 15:00 and has an external follows dependency on the closest earlier instance of the job stream Js1 running on the same day. The two job streams are defined in this way:
When the schedules are included in the plan, the sequence of graphics illustrate how the dependency is resolved:SCHEDULE MY_MASTER#JS1 ON RUNCYCLE RULE1 "FREQ=WEEKLY;BYDAY=TH" (AT 0700) ON RUNCYCLE RULE2 "FREQ=DAILY" (AT 0800) : MY_MASTER#JOB1 AT 0900 END SCHEDULE MY_MASTER#JS2 ON RUNCYCLE RULE2 "FREQ=DAILY;" FOLLOWS MY_MASTER#JS1.@ SAMEDAY : MY_MASTER#JOB2 AT 1500 END
- On Thursdays, the instance of Js2 scheduled at
06:00 depends on the instance of Js1 scheduled to
run at 07:00. On any other day of the week, Js2 has
a dependency on the instance of Js1 scheduled at
08:00. Figure 7 shows the status
of the two job streams in the plan at 06:00 (SOD) on Thursday:Figure 7. Sameday matching criteria - Step 1: at Start of Day (SOD) on a Thursday
- At 09:00, Js1.job1 starts and Js1 changes
status. Js2.job2 is held until its scheduled time.Figure 8 shows the status of the job streams
in the plan at 09:00.Figure 8. Sameday matching criteria - Step 2: at 9:00
- On Thursdays at 15:00, Js2 changes to ready status
and Js2.job2 starts. Figure 9 shows
the status of the two job streams in the plan at 15:00.Figure 9. Sameday matching criteria - Step 3: at 15:00
- On Thursdays, the instance of Js2 scheduled at
06:00 depends on the instance of Js1 scheduled to
run at 07:00. On any other day of the week, Js2 has
a dependency on the instance of Js1 scheduled at
08:00. Figure 7 shows the status
of the two job streams in the plan at 06:00 (SOD) on Thursday:
- Closest preceding
- In this example, two job streams, Js1 and Js2, each have one job. The job in Js2 has an external follows dependency on the closest preceding instance of the job in Js1. The two job streams are defined in this way:
Job stream Js1 runs every day at 0800 and on Thursdays and Fridays also at 0900. Job stream Js2 runs every day at 1200, and has an external dependency on the closest preceding instance of Js1. When the job streams are included in the plan, the sequence of graphics illustrates how the dependency is resolved:SCHEDULE MY_MASTER#JS1 ON RUNCYCLE RULE1 "FREQ=DAILY;" (AT 0800) ON RUNCYCLE RULE2 "FREQ=WEEKLY;BYDAY=TH,FR" (AT 0900) : MY_MASTER#JOB1 END SCHEDULE MY_MASTER#JS2 ON RUNCYCLE RULE1 "FREQ=DAILY;" (AT 1200) FOLLOWS MY_MASTER#JS1.@ PREVIOUS : MY_MASTER#JOB2 AT 1500 END
- Before 12:00 on Thursdays and Fridays, there are two instances
of Js1.Job1. Job stream Js2 has
a dependency on the instance of Js1.Job1 that is
scheduled to run at 09:00, because it is the closest preceding in
terms of time. Figure 10 shows the
status of the two job streams in the plan on Thursdays and Fridays.Figure 10. Closest preceding matching criteria - Step 1: before 08:00
- On any other day of the week, the only instance of Js1.Job1 in
plan, is the one scheduled to run at 08:00. In this case, Js2 has
a dependency on this instance. When Job1 completes
successfully, the status of Js2 becomes Ready. Figure 11 shows the status of the two job
streams in the plan on any other weekday except Thursdays and Fridays.Figure 11. Closest preceding matching criteria - Step 2: at 08:00 on weekdays except Thursdays and Fridays
- On Thursdays and Fridays at 09:00, the second instance of Js1.Job1 completes
successfully. Job stream Js2 changes to Ready. Js2.Job2 is
held until its scheduled start time. Figure 12 shows
the status of the two job streams in the plan.Figure 12. Closest preceding matching criteria - Step 3: at 09:00 on Thursdays and Fridays
- At 15:00 the time dependency of Js2.Job2 is satisfied
and Job2 starts. Figure 13 shows
the status of the two job streams in the plan at 15:00.Figure 13. Closest preceding matching criteria - Step 4: at 15:00 on every day
- Before 12:00 on Thursdays and Fridays, there are two instances
of Js1.Job1. Job stream Js2 has
a dependency on the instance of Js1.Job1 that is
scheduled to run at 09:00, because it is the closest preceding in
terms of time. Figure 10 shows the
status of the two job streams in the plan on Thursdays and Fridays.
- In this second example, the difference between the use of sameday and closest preceding matching criteria in a plan is described. Job stream Js1 runs every Friday at 0900, while job stream Js2 and Js3 run every Saturday at 0900. The three job streams are defined in this way:
Job stream Js2 has an external dependency on the closest preceding instance of Js1, which is resolved as described in the previous example. Job stream Js3 is defined with sameday matching criteria, so it does not have any dependency on job stream Js1, because Js1 is not defined to run on the same day as Js2.SCHEDULE ACCOUNTING#JS1 ON RUNCYCLE RULE1 "FREQ=WEEKLY;BYDAY=FR" : ACCOUNTING#JOB1 AT 0900 END SCHEDULE ACCOUNTING#JS2 ON RUNCYCLE RULE2 "FREQ=WEEKLY;BYDAY=SA" FOLLOWS ACCOUNTING#JS1.@ PREVIOUS : ACCOUNTING#JOB1 AT 0900 END SCHEDULE ACCOUNTING#JS3 ON RUNCYCLE RULE2 "FREQ=WEEKLY;BYDAY=SA" FOLLOWS ACCOUNTING#JS1.@ : ACCOUNTING#JOB1 AT 0900 END
- Within a relative interval
In this example, the job or job stream instance considered to resolve the dependency is the closest one in a time interval of your choice, which is defined relatively to the time when the instance that includes the dependency is scheduled to run. Job stream Js1 is scheduled to run every day at 15:00 and on Thursdays also at 08:00. Js2 is scheduled to run every day at 13:00 and on Thursdays also at 06:00, because no specific time is defined in the run cycle, it is scheduled at start of day time. Js2 uses the relative interval criteria (-04:00 to +04:00) to determine which instance is used to solve the dependency. The interval is based on the time the job stream enters the plan. The job streams are defined as follows:
At plan creation time, conman showjobs produces the following output:SCHEDULE MY_MASTER#JS1 ON RUNCYCLE RULE1 "FREQ=WEEKLY;BYDAY=TH" (AT 0800) ON RUNCYCLE RULE2 "FREQ=DAILY" (AT 1500) : MY_MASTER#JOB1 END SCHEDULE MY_MASTER#JS2 ON RUNCYCLE RULE3 "FREQ=WEEKLY;BYDAY=TH" ON RUNCYCLE RULE2 "FREQ=DAILY;" (AT 1300) FOLLOWS MY_MASTER#JS1.@ RELATIVE FROM -0400 TO 0400 : MY_MASTER#JOB2 AT 1300 END
Figure 14 shows the status of the job streams in the plan at start of day on Thursday.%sj @#@ (Est) (Est) CPU Schedule SchedTime Job State Pr Start Elapse RetCode Deps MY_MASTER#JS1 0800 11/13 ******** READY 10 (00:06) JOB1 HOLD 10 (00:06) MY_MASTER#JS1 1500 11/13 ******** READY 10 (00:06) JOB1 HOLD 10 (00:06) MY_MASTER#JS2 0600 11/13 ******** HOLD 10 JS1(0800 11/13/09).@ JOB2 HOLD 10(13:00) MY_MASTER#JS2 1300 11/13 ******** HOLD 10(13:00) JS1(1500 11/13/09).@ JOB2 HOLD 10(13:00)
Figure 14. Relative Interval matching criteria - at start of day on ThursdayThe instance of Js2 scheduled at 06:00 has a dependency on Js1.job1 which is scheduled at 08:00, within the relative interval based on the scheduled time (06:00). Js2.job2 depends on the instance of Js1.job1 within the relative interval based on the scheduled time (13:00). When the instance of Js1.job1 starts at 08:00, the status ofJs2 changes to Ready. From this point onwards, the sequence in which the job streams and jobs run follows the typical process.- Within an absolute interval
- In this example, the job or job stream instance considered to resolve the dependency is the closest one in a fixed time interval of your choice. The time interval specifies the time of day on which the interval begins and the time of day on which it ends, either on the same day as the instance that includes the dependency, or on a day defined relatively to that date. Js1 is scheduled to run every day at 08:00 and on Thursdays also at 07:00. Job Js1.job1 is scheduled to run at 09:00. Job stream Js2 is scheduled every day at 10:00 and on Thursdays also at start of day (06:00) and has a dependency on Js1 based on the absolute interval occurring on the same day between 06:00 and 11:00. The job streams are defined as follows:
At plan creation time, conman showjobs produces the following output:SCHEDULE MY_MASTER#JS1 ON RUNCYCLE RULE1 "FREQ=WEEKLY;BYDAY=TH" (AT 0700) ON RUNCYCLE RULE2 "FREQ=DAILY" (AT 0800) : MY_MASTER#JOB1 AT 0900 END SCHEDULE MY_MASTER#JS2 ON RUNCYCLE RULE3 "FREQ=WEEKLY;BYDAY=TH" ON RUNCYCLE RULE2 "FREQ=DAILY;" (AT 1000) FOLLOWS MY_MASTER#JS1.@ FROM 0600 TO 1100 : MY_MASTER#JOB2 AT 1300 END
Figure 15 shows the status of the job streams in the plan at start of day on Thursday.%sj @#@ (Est) (Est) CPU Schedule SchedTime Job State Pr Start Elapse RetCode Deps MY_MASTER#JS1 0700 11/13******** READY 10 (00:06) JOB1 HOLD 10(09:00)(00:06) MY_MASTER#JS1 0800 11/13 ******** READY 10 (00:06) JOB1 HOLD 10(09:00)(00:06) MY_MASTER#JS2 0600 11/13 ******** HOLD 10 JS1(0700 11/13/09).@ JOB2 HOLD 10(15:00) MY_MASTER#JS2 1000 11/13 ******** HOLD 10(10:00) JS1(0800 11/1309).@ JOB2 HOLD 10(15:00)
Figure 15. Absolute interval matching criteria - at start of day on ThursdayAt 09:00, Js1.job1 starts, and at 10:00 the dependency is released and Js2 becomes ready. From this point onwards, the sequence is the same as described in the previous matching criteria.