Dependent Jobs

  1. Dependent Jobs
    1. Dependent Job Networks
    2. Dependent Job Processing
        1. Figure 3-1: Dependent Job Processing Example (1)
    3. Passing Symbolic Variables and Submitting Other Jobs
      1. Sample Dependency Form
    4. Steps Required to Create the Jobstream
      1. Step 1
        1. Figure 3-3: Example of the Creation of a PANEL.
      2. Step 2
      3. Step 3
        1. Figure 3-4: Dependent job Processing Example (2)
      4. Step 4
      5. Step 5

Dependent Job Networks

This section of the manual discusses another method you can use to chain together many jobs to run in a particular sequence. The examples shown here demonstrate how you can SUBMIT a job from a currently executing job. The previous chapter showed how you can have Jol manage a network and SUBMIT a job or jobs after a particular job or group of parallel running jobs has ended.

The major differences between the two methods are:

  1. Dependent job processing allows you to SUBMIT a job at any time from the current job. You code the SUBMIT instructions at appropriate points in your Jol program. The SUBMIT commands can be coded before the job ends, and allows for parallel processing, but you cannot wait for two jobs to terminate before submitting another.
  1. With Job Networking, Jol manages the submission of jobs and controls parallel execution of jobs and the waiting for the termination of jobs before submitting other jobs in the network. Basically, you code your Jol programs as though they are independent jobs, and then code a special set of Jol network instructions that then submit the jobs in the desired sequence for you.

  • Note: With Job Networking  jobs are usually submitted only when the current job ends, although you can force Jol to examine the status of the network at any time, and depending on the status, submit other jobs.

It is recommended that you be familiar with, or review, the SUBMIT and SAVESYMS commands. These commands, with their protocols, are explained in the Jol Reference Manual and Jol Reference Guide, and in the Appendices of this book.

Dependent Job Processing

Jol provides facilities to effectively schedule dependent jobstreams. That is, the dependent job is not compiled or placed on the system job queue until the current job has reached a point where it is desirable or safe to run the dependent job. By using this technique, a linkage can be created which controls the sequence of running a number of jobs.

Figures 3-1 and 3-2 on the following pages illustrate the use of these commands.

An Example of Dependent Job Processing.

Statement Jol Code


        JOB1: etc.



                            Jol code



    1     STEP1:   RUN PROGRAM1 ;

    2                      IF STEP1=0 THEN

    3                      SUBMIT JOB2 ;

    4     STEP2:  RUN PROGRAM2 ;





Statement 1 Instructs Jol to execute PROGRAM1.

Statement 2 Checks the completion code of PROGRAM1.

Statement 3 Instructs Jol to SUBMIT JOB2 to the system job queue if the conditions are satisfied.

Statement 4 Continues the processing of JOB1.

Figure 3-1: Dependent Job Processing Example (1)

Passing Symbolic Variables and Submitting Other Jobs

Creating a more complex Dependent Jobstream for a particular application, which may consist of 2 or more jobs, requires certain considerations. You need to determine:

  • The sequence of the run i.e., JOB1, JOB2 etc.
  • All of the variable symbolic names across the jobstream.
  • The JOB to program dependencies.

    Table 3-2 shows a simple example of a Payroll Application system.

    Note: The following example shows one method that can be used to pass symbolic data from one job to another. Another method to pass symbolic variables from Job to Job is to use the SYMS Parameter with the SUBMIT Command. See the SUBMIT Command details for further information.

Sample Dependency Form

MIS System Dependency Chart Form Number MIS-DP1


System ID PAYROLL Prepared by:                      Date:

Values from
System Scheduler
1   PAYJOB1 -----
%Cycle, %State, %Div
JOB1 After STEP20 %State, %Div
3   PAYJOB3 JOB1 After STEP25 -----
4   PAYJOB4 JOB3 %Cycle





Figure 3-2: Example of a Payroll Jobstream

Note the following concerning the example above:

  1. There are four jobs in the Payroll system.

  2. Job PAYJOB2 can be run after job PAYJOB1 has completed STEP20 successfully.

  3. Job PAYJOB3 can be run after job PAYJOB1 has completed STEP25 successfully.

  4. Job PAYJOB4 can be run after job PAYJOB3 has completed successfully.

  5. The symbolic variables CYCLE, STATE, DIV are used by the Payroll system.

Steps Required to Create the Jobstream

To create a sequence of jobs as described above, and to pass the required symbolic variable data through to each job automatically may be done in a manner similiar to that described below.

Step 1

Create a 'PANEL' in PAYJOB1 to request the values for the variables (see table 3-2). Figure 3-3 below shows an example of a 3270 PANEL for the job.


Figure 3-3: Example of the Creation of a PANEL.

Step 2

Once the content of the supplied data has been verified, store the values of the variables in a member of a PDS for use by the other jobs, or in case of a rerun or restart. This process will eliminate the need to re-input the values. To store the data, use the SAVESYMS command. For example:


        IN 'dataset-name(member)';

Step 3

In order for PAYJOB1 to SUBMIT PAYJOB2 and PAYJOB3 at the desired points, code the command for Jol to SUBMIT PAYJOB2 and PAYJOB3 (see example below).




                Jol code




STEP20:     RUN PROG20 ; /* Jol Instruction to Execute PROG20*/

                    IF STEP20=0 THEN /* Check the Condition Code*/

                         SUBMIT PAYJOB2; /* If satisfied, SUBMIT PAYJOB2*/




        Further Run Instructions




STEP25:   RUN PROG25 ;

                    IF STEP25=0 THEN

                        SUBMIT PAYJOB3 ;

Figure 3-4: Dependent job Processing Example (2)

When Jol activates the SUBMIT command, the job is placed on the system job queue and runs as an independent job.

Step 4

When creating the Jol code for PAYJOB2 and PAYJOB4 - both require symbolic substitution - issue, as part of the code, an instruction for Jol to INCLUDE the stored symbolic values from PAYJOB1. The format of the instruction is:

INCLUDE member-name ;

Now the need for entering data values again is eliminated, which reduces the incidence of error.

Step 5

For PAYJOB3 to SUBMIT PAYJOB4, use the method outlined in Step 3.

Note the following concerning this example:

The system outlined in the example is very simple, however, if required, far more complex schedules can be handled with ease. Using Jol's CALENDAR, dependencies based on the day of the week (e.g. Friday), month, year, and so on, can be incorporated into the code so that correct schedules are run automatically without constant supervision or manual decision.

Jobs are not placed on the system jobqueue, to be released in error, unless they are able to run. This removes the need for Operator decision because "IF ITS ON THE QUEUE RUN IT" becomes a true statement.