The Job Dependent tool provides a series of commands that allow a
Master Job to be defined with Dependent Jobs. Each Dependent Job can
be defined to have dependencies such as the successful completion or
failure of another Dependent Job, a switch setting, or if an object
exists. At various points, the Dependent Jobs are tested to
determine if their dependencies are met and if so, a Dependent Job is
submitted to batch.
The Job Dependent tool provides a variety of advantages such as the
ability to run two Dependent Jobs simultaneously and have a third
Dependent Job run later if both prior Dependent Jobs have completed
successfully.
For example,
JOBA is submitted to JOBQ1
JOBB is submitted to JOBQ2
JOBC should not be submitted unless both complete normally
Each set of Dependent Jobs is controlled by a Master Job. The Master
Job is not an actual job on the system, but rather a user assigned
name that is used to group a set of dependent jobs together. For
example:
*********** ************
* * Master * *
* MASTER1 *>>>>>v Jobs * MASTER2 *>>>>>>v
* * v * * v
*********** v ************ v
************* ************
* * * *
* SUB1 * Dependent * SUBA *
************* * Jobs ************ *
* * * * * *
* SUB2 **** * SUBB ****
* * * *
************* ************
Data base files are used to hold the Master Job and Dependent Job
definitions. Each set of files may hold multiple Master Jobs. You
can have multiple sets of files, but only one per library.
All work is submitted using the same user profile. A default Job
Description and default Job Queue is defined for the Master Job.
Each Dependent Job may use the default or name its own Job
Description and/or Job Queue.
Demonstrating the Job Dependent tool
------------------------------------
The best way to understand the JOBDEP tool is to run the provided
demonstration. A separate documentation member (JOBDEP2) is provided
which describes the demo.
Use the DSPTAA command to display or print the demonstration
information:
DSPTAA JOBDEP2 OUTPUT(xxxx)
Getting started
---------------
** The CRTJOBDEPD command will create the objects used by the
JOBDEP tool.
CRTJOBDEPD LIB(xxx)
** Define the Master and Dependent Jobs with
WRKJOBDEPD
** Use F6 to define a new Master Job. After the Master Job is
defined, use 'Option 9 = Dependent jobs' to define the
Dependent Jobs and their conditions. Use F6 to add a new
Dependent Job and its dependencies (if any). You can add the
dependencies at a later time by using 'Option 2 = Change'.
See the other sections in this document for how to define
dependencies and other functions of the tool.
Start Job Dependent command
---------------------------
The STRJOBDEP command starts a Master Job. It resets all switches,
date/time information, status, etc. Any Dependent Jobs that do not
have any dependencies are submitted.
Job Completion Dependency Testing
---------------------------------
The most typical dependency test is one that is based on whether
another Dependent Job has completed successfully or abnormally.
For each 'Function' you enter as a Dependent Job name, you can
specify *PASS, *FAIL or *END.
*PASS - Job completed normally (did not end with
an escape message)
*FAIL - Job ended abnormally (with an escape message)
*END - Job ended either normally or abnormally
For example, you may want BILLING2 to run if BILLING1 has
successfully completed. You would enter for BILLING2:
Function Condition
-------- ---------
BILLING1 *PASS
Note that you can only test a Dependent Job within the same Master
Job.
Switch Dependency Testing
--------------------------
You can define up to 8 switches (*SW1 - *SW8) for each Master Job and
use the switches to determine when a dependency is met.
For example, you may want to run some Dependent Jobs and then wait
until a switch is set from some other application or user function.
The switch could be set by any job on the system (not just a
Dependent Job).
For each 'Switch condition', you can specify *ON or *OFF.
*ON - The switch has been set
*OFF - The switch has not been set
or has been set off
To define a switch, use the WRKJOBDEPD Option 2 (Change) for a Master
record and then rollup. The display lets you define up to 8
switches. The entry of a text definition 'defines the switch'. A
switch must be defined in the Master before it can be used as a
dependency or used by SETJOBDEP.
To cause a dependency on a switch, use WRKJOBDEPD with the 9 =
Dependent jobs' option. For the Dependent Job you want to test the
switch for, use the '2 = Change' option, rollup to the Function and
Condition Display and specify an entry such as:
Function Condition Text
-------- --------- ----
*SW1 *ON If payroll is complete
In any job (not just a Dependent Job) you can set the switch with the
SETJOBDEP command:
SETJOBDEP MSTJOB(BILLING) SWITCH(*SW1) SETTING(*ON)
Using SETJOBDEP causes the JOBDEP tool to set the switch and then
test to see if any Dependent Jobs should be submitted. To use
SETJOBDEP you must have 'defined the switch' by entering a text
definition with WRKJOBDEPD.
You can only use SETJOBDEP, when a Master Job is in process. See the
section on 'Master Job Status'.
When STRJOBDEP is used, the switch setting is blank. Either blank or
*OFF is considered *OFF. It is valid to set the same switch on or
off multiple times.
Two errors can occur with SETJOBDEP:
** Using SETJOBDEP to set a switch that is not defined in the
Master Job.
** Using SETJOBDEP when the Master Job has not been started or
has been completed. The Master Job must be in some form of
'in process' when SETJOBDEP occurs. See the section of
'Master Job Status'.
If you are not sure that the Master Job will have been started
when some other job wants to set a switch, you should use an
'Object Existence' test instead of a switch.
Object Existence Dependency Testing
-----------------------------------
You can define up to 5 objects that can be tested for existence.
For example, you may want to run some Dependent Jobs after some job
on the system creates a data area. The object could be created by
any job on the system (not just a Dependent Job).
To test an object, the dependency condition must be either:
*EXIST - The object must exist
*NOTEXIST - The object must not exist
Any object on the system may be tested (CHKOBJ is used).
To define an object to be checked for existence, use the WRKJOBDEPD
'2 = Change' option for a Master Job record and then rollup twice.
You must enter an object name, a library name, and an object type.
You must use an actual library name (not *LIBL).
An object must be defined in the Master Job before it can be used to
condition a Dependent Job.
To cause a dependency on an object's existence, use WRKJOBDEPD with
the '9 = Dependent jobs' option. For the Dependent Job you want to
test for an 'Object Existence', use Option 2 (Change), rollup to the
'Function and Condition Display', and specify an entry such as:
Function Condition Text
-------- --------- ----
*OBJ1 *EXISTS If the *DTAARA exists
Creating an object that must exist as a dependency will not cause a
Dependent Job to be submitted. It only allows the other functions
that cause testing of dependencies to check for the existence or
non-existence of the object. See the section on 'Testing for
Submission'.
You must provide a technique to ensure that the object does not
exist. You could:
** Have an initial Dependent Job delete the object.
** Have the Dependent Job that is submitted if the object exists,
delete the same object.
Testing for Submission
----------------------
The only functions that cause testing to allow submission of
Dependent Jobs are:
STRJOBDEP - Starts a Master Job
Dependent Job - When it completes
SETJOBDEP - Sets a switch
CHKJOBDEP - Checks a Dependent Job
Note that creating an object that will be 'tested for existence' will
not cause the submission checking to occur. One of the above
functions must occur after the object is created.
When testing for submission occurs, none, one, or several Dependent
Jobs may be submitted.
Using multiple Functions and Conditions
---------------------------------------
Up to 9 Functions in any 'and/or' relationship can be specified to
determine if a Dependent Job should be submitted. For example, you
might have a Dependent Job conditioned as:
Function Condition Text
--------- --------- ----
*OBJ1 *EXISTS If the *DTAARA exists
*AND BILLING2 *PASS If it went well
*AND BILLING3 *PASS If it went well
*AND *SW1 *ON If the switch is set
*AND *SW2 *OFF If the switch is not set
Note that the default is an 'and' so that all 'conditions' must be
met before the Dependent Job is submitted.
You can specify a simple *OR condition such as:
Function Condition Text
--------- --------- ----
*OBJ1 *EXISTS If the *DTAARA exists
*OR BILLING2 *PASS If it went well
You can have multiple 'or' conditions.
Function Condition Text
--------- --------- ----
*OBJ1 *EXISTS If the *DTAARA exists
*OR BILLING2 *PASS If it went well
*OR BILLING3 *FAIL If it failed
You can use a combination of *AND/*OR such as:
Function Condition Text
--------- --------- ----
*OBJ1 *EXISTS If the *DTAARA exists
*AND BILLING2 *PASS If it went well
*OR BILLING3 *PASS If it went well
*AND *SW1 *ON If the switch is set
*AND *SW2 *OFF If the switch is not set
When an *OR exists, all prior entries (to a prior *OR if it exists)
are considered a group and all must be met for the Dependent Job to
be submitted. In the above example, the first group is *OBJ1 and
*BILLING2. The second group is BILLING3, *SW1, and *SW2.
Note that the maximum is 9 conditions for any Dependent Job.
However, you can have an unlimited number of conditions by entering a
dummy Dependent Job (such as call a CL program that just does a
return) that is only run if 9 conditions are met. Then use the fact
that the dummy job completed normally to condition another Dependent
Job with additional conditions.
Ending a Master Job
-------------------
A Master Job is ended:
** When all Dependent Jobs have been completed. The *END status
would occur automatically.
This is normally only effective if a simple function such as
specified in the BILLING test data where Dependent Jobs have
*PASS conditions and all are successful. It is not effective
if you have Dependent Jobs that run if either a previous
Dependent Job completes normally or fails.
For example, consider the following:
Dependent Job Function Condition
------------- -------- ---------
BILLING1
BILLING2 BILLING1 *PASS
BILLING3 BILLING1 *FAIL
Either BILLING2 or BILLING3 will run, but since one Dependent
Job will not run, the Master Job does not complete. To end
the Master Job, you must use one of the other methods.
** Use the option to 'End Master if completed' for any Dependent
Job. The default is *NO. The option is specified in the
Dependent Job record.
In the previous example, both BILLING2 and BILLING3 could
specify *YES for 'End Master if completed'.
** Use the ENDJOBDEP command. Normally this would only be used
when the previous solutions cannot be used or you want to
reset the job after some error has occurred.
Master Job status
-----------------
Each Master Job has a 'status'. The status controls what is valid
for certain other commands. If the status is some form of 'in
process', the job has been started, but has not been completed.
Status In Process Description
------ ---------- -----------
blank At completion of CRTJOBDEPD
*STARTED Yes Set by STRJOBDEP
*PROCESS Yes Set when first job is submitted
*HELD Yes Set by HLDJOBDEP
*END Set by 'End Master if completed'
*END Set if all Dep Jobs are complete
*END Set by ENDJOBDEP
If the *END status exists, you can determine how it was set. Another
line of information follows the status with how the *END was
achieved.
Function that End End
sets *END Function Information
------------- -------- -----------
End of Dep Job *DEPJOB Dependent Job name
All Deps complete *COMPLETE
ENDJOBDEP *USER User name
Batch Control Program
---------------------
The program which is submitted for any batch job is TAAJODFC99. The
command you enter for the batch job is passed as a parameter.
TAAJODFC99 remains at the top of the program stack throughout the
job. It runs your command and waits for a return. It monitors for
all error conditions.
When your command completes (normally or abnormally), the Job
Dependent files are updated and if dependencies are met, other
dependent jobs may be submitted.
Working with a Master Job
-------------------------
The WRKJOBDEPD command displays and allows changes to the description
of the Master and Dependent Jobs. Once the definition is complete,
the command you will want to use is WRKJOBDEP.
WRKJOBDEP provides several options to work with the Master and
Dependent Jobs, but does not allow changes to the description.
Options exist to start, end, hold, release, print, or display.
Displaying the status allows you to determine:
- The status of the Master and Dependent Jobs
- When the Master Job was started and ended
- The status of each Switch and the last job that did a Set
- Whether the objects for 'object existence tests' exist
- When each Dependent Job was submitted, started, and ended
- The completion code for each Dependent Job
- The definitions of all switches, objects, and Dependent Jobs
Unique Dependent Job names
--------------------------
Within each Master Job, the Dependent Job names must be unique. If
the same job should occur based on different conditions, use an *OR
relationship as described in the section on 'Using multiple
conditions'.
The sequence on the display is alphabetical by Dependent Job name.
This does not require that the Dependent Jobs will be run in this
manner.
A warning message will occur if a Dependent Job name is entered as a
Function and the Dependent Job does not exist within the Master
group. Pressing 'Enter' will bypass this warning, but you must
ensure that you define the Dependent Job name. An escape message
will occur on STRJOBDEP if a Function describes a Dependent Job that
does not exist.
History information
-------------------
When a Master Job is complete (reaches the *END status), the Master
and Dependent Job records are copied to history files in the same
library. These records include the same information that can be
displayed with WRKJOBDEP. This allows a review of past uses of the
Job Dependent function. History information can be displayed by:
DSPJOBDEPH MSTJOB(xxx)
Printing Descriptions and Status
--------------------------------
Three commands exist:
- PRTJOBDEPD - Prints the Master and Dependent descriptions
- PRTJOBDEP - Prints the status information
- PRTJOBDEPH - Prints the status information from history
The commands may also be run from WRKJOBDEPD, WRKJOBDEP and
DSPJOBDEPH.
Retrieving Descriptions and Status
----------------------------------
Two commands exist:
- RTVJOBDEPD - Retrieves Master description and status
- RTVJOBDEP - Retrieves Dependent Job description and status
Time Dependent Scheduling
-------------------------
There is no support for time dependent scheduling within the JOBDEP
tool.
However, you can use the system Job Scheduling function (WRKJOBSCDE)
and cause a job to start at a specific time. The command for the job
you start could be STRJOBDEP.
You could also cause a Dependent Job to run no earlier than a
specific time by having a job schedule entry that does SETJOBDEP of a
switch and condition the Dependent Job on the switch.
Maintaining the History Files
-----------------------------
The history files must be periodically maintained when you no longer
need the old information. Maintenance can be done by either entering
a command or automatically:
** Entering the MTNJOBDEPH command allows you to specify the
number of days of information that you want to retain.
MTNJOBDEPH RTNDAYS(nn)
MTNJOBDEPH determines the retention date and then copies
records based on the retention date to created work files in
the same library and then copies back with MBROPT(*REPLACE).
The work files are then deleted.
** The automatic maintenance function is controlled by the first
use of STRJOBDEP for each day and a data area containing the
'last date when automatic maintenance was run'.
The data area is created by CRTJOBDEPD in the same library as
the required files. When STRJOBDEP is run, the last date
information is accessed. If the value is other than the
current day, the Application Value JOBDEP in the TAASECURE
library is accessed. It contains two values:
-- FREQDAYS. The frequency in days of how often the
MTNJOBDEPH should be run. The default is 7 meaning
every 7 days the MTNJOBDEPH command would be run
automatically. A 0 value prevents the automatic
maintenance function.
-- RTNDAYS. The number of days to retain the history
information. The default is 8 to retain the data for 8
days.
If the last date of automatic maintenance indicates that the
file does not need to be maintained, the STRJOBDEP command
continues normally. If it is time to perform maintenance, the
MTNJOBDEPH command is run with the RTNDAYS value coming from
the Application Value.
Using the defaults would provided 8 to 15 days of history.
The Application Value can be changed to meet your
requirements. A user with *ALLOBJ special authority can
enter:
EDTAPPVAL APPVAL(TAASECURE/JOBDEP)
If the system fails during the copying back from the work files to
the history files, the history data may be lost. You could check for
the existence of the work files and perform your own copy. Look for
the names:
JOBDEPHBMP Master backup
JOBDEPHBDP Detail backup
After a successful copy, the work files are deleted.
Test Function
-------------
A test function exists on STRJOBDEP (see additional parameter TEST)
that allows you to specify a test of your Dependent Jobs.
Instead of submitting the program you specified for a Dependent Job,
the TAAJODFC30 test program is submitted. This forces the job log
with LOG(4 0 *SECLVL) and sends a special message to the job log
indicating the test function. The Master Job record will indicate
that the Test function was used.
Note that the test program which is submitted will always complete
normally so you cannot test the Dependent Jobs that you want to run
if an abnormal completion occurs.
Holding and Releasing Dependent Jobs
------------------------------------
You may hold or release a Master and Dependent Jobs using HLDJOBDEP
and RLSJOBDEP. You must name a Master Job. A Dependent Job is
optional.
With HLDJOBDEP, you can specify *ALL Dependent Jobs, a specific
Dependent Job, or no (*NONE) Dependent Jobs. The Master Job will
always be held to prevent new work from starting. Individual
Dependent Jobs will be held if requested.
The RLSJOBDEP is the inverse of HLDJOB. The Master Job must have
been held by HLDJOBDEP. The Master Job is optionally released and
you can optionally release all, one, or no Dependent Jobs.
The system commands HLD/RLSJOB can also be used, but the JOBDEP
function will not be aware that the jobs are held. HLDJOBDEP and
RLSJOBDEP are preferred.
Abnormal termination
--------------------
If needed, you may use ENDJOBDEP to end a Dependent Job or to end the
Master Job. Using ENDJOBDEP is a better solution than the system
command ENDJOB because the JOBDEP function is then aware of what has
occurred.
If an abnormal termination occurs outside of the JOBDEP function, the
Dependent Job will not be known to have failed by JOBDEP. For
example, if you use ENDJOB to end a Dependent Job, the information
about the failure will not be known to JOBDEP. The same result would
occur with ENDSBS or a system failure.
While you may be able to submit some of the jobs manually based on
what has occurred, the more typical solution would be to use
ENDJOBDEP and then restart the process with STRJOBDEP.
Maintaining JOBDEP files on different systems using UPDJOBDEPD
--------------------------------------------------------------
You can maintain the same JOBDEP files (or a subset) on other systems
using the following technique:
** Save the JOBDEPMSTP and JOBDEPDTLP files (or DDM could be
used).
** Transport the save information to a different system and
restore to a unique library.
** Use UPDJOBDEPD to add or update one or all Master Jobs. For
example:
UPDJOBDEPD FRMJOBDEPL(xxx) TOJOBDEPL(yyy) MSTJOB(JOB1)
This would copy the description of Master Job JOB1 and its associated
Dependent Jobs from one library to another.
If the JOB1 name already exists in the To Library, the records are
deleted first and then the new records are added from the From
Library. You can also specify MSTJOB(*ALL) to update or add from the
From Library to the To Library.
To delete a Master Job, you can specify:
UPDJOBDEPD FRMJOBDEPL(*NONE) TOJOBDEPL(yyy) MSTJOB(JOB1)
OPTION(*DLT)
When *DLT is used, you must name a single Master Job and
FRMJOBDEPL(*NONE) must be used.
The history files are not changed by UPDJOBDEPD. The status fields
are initialized for new or updated records.
UPDJOBDEPD can also be used on an individual system to add or update
Master Job records from one library to another. The *DLT option may
also be used.
For each Master Job processed, UPDJOBDEPD attempts to delete any
records from both JOBDEPMSTP and JOBDEPDTLP files. If the Master
does not exist in JOBDEPMSTP, an attempt to delete the records from
JOBDEPDTLP still occurs.
The files are not reorganized.
Commands provided
-----------------
A menu of the JOBDEP commands exist which may be accessed by:
GO JOBDEP
Most of the commands may be run from the menu.
The supported commands are:
Commands that operate on Job Dependent Descriptions
---------------------------------------------------
CRTJOBDEPD Creates the objects used by JOBDEP
DLTJOBDEPD Deletes the objects used by JOBDEP
WRKJOBDEPD Works with Master and Dependent definitions
PRTJOBDEPD Prints the Job Dependent Descriptions
RTVJOBDEPD Retrieve Master Job Description and status
UPDJOBDEPD Update Master Job Description
Commands that Start, End, Work etc on a Job Dependent Structure
---------------------------------------------------------------
STRJOBDEP Starts a Master Job
ENDJOBDEP Ends a Master Job or a Dependent Job
CHKJOBDEP Checks a Master Job for submission
HLDJOBDEP Holds a Master Job
RLSJOBDEP Releases a Master Job
SETJOBDEP Sets a switch and test for submission
WRKJOBDEP Works with a Master Job and Dependent status
PRTJOBDEP Prints the Job Dependent current information
RTVJOBDEP Retrieve Dependent Job description and status
Commands that Operate on Job Dependent History
----------------------------------------------
DSPJOBDEPH Displays the history of Master and Dependents
PRTJOBDEPH Print the history of Master and Dependents
MTNJOBDEPH Maintains the history files
Data Base files created by CRTJOBDEPD
-------------------------------------
Name Source Mbr Description
---- ---------- -----------
JOBDEPMSTP TAAJODFP Master Job - Keyed
JOBDEPMSTL TAAJODFL Master Job - Arrival seq
JOBDEPDTLP TAAJODFQ Dependent Job - Keyed
JOBDEPDTLL TAAJODFM Dependent Job - Arrival seq
JOBDEPHSMP TAAJODFU Master Job history - Keyed
JOBDEPHSML TAAJODFW Master Job history - Arrival seq
JOBDEPHSDP TAAJODFV Dependent Job history - Keyed
JOBDEPHSDL TAAJODFX Dependent Job history - Arrvl seq
The TAAJOBDEP data area is also created in the named library.
JOBDEP escape messages you can monitor for
-------------------------------------------
Most of the commands either send CPF9898 for command validation
errors or resend messages from based on functions.
The following are unique message IDs you may wish to monitor for:
STRJOBDEP
---------
TAA9891 Master Job not in correct status to allow start
ENDJOBDEP
---------
TAA9893 Dependent Job does not exist
TAA9894 Dependent Job not submitted, wrong status
TAA9895 Dependent Job could not be ended
SETJOBDEP
---------
TAA9891 Master Job not in correct status to allow set
TAA9892 Master Job does not have a definition for the switch
HLDJOBDEP
---------
TAA9891 Master Job not in correct status to allow hold
RLSJOBDEP
---------
TAA9891 Master Job not in correct status to allow release
RTVJOBDEPD
----------
TAA9891 Master Job not found
RTVJOBDEP
---------
TAA9891 Master or Dependent Job not found
PRTJOBDEPD
----------
TAA9891 Master Job not found
PRTJOBDEP
---------
TAA9891 Master Job not found
UPDJOBDEPD
----------
TAA9893 Master Job not found
CRTJOBDEPD Parameters *CMD
---------------------
JOBDEPPLIB The library where the JOBDEP objects should be
created.
SRCLIB The source library to use for the QATTDDS file
source. The default is *TAAARC. If a full license
exists, the source is used from the TAA Archive. If
a demonstration license exists, the source is used
from the QATTDDS file in the TAATOOL library.
A specific user library may be named, but the source
file must be QATTDDS.
DLTJOBDEPD Parameters *CMD
---------------------
JOBDEPPLIB The library where the JOBDEP objects exist.
WRKJOBDEPD Parameters *CMD
---------------------
MSTJOB The name of the Master Job to be worked with. The
default is *ALL for all Master Jobs.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
STRJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to be started.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
TEST A *YES/*NO value for whether the JOBDEP test
function will be used. *NO is the default.
The TEST parameter is an Additional Parameter (use
F10). If *YES is specified, the test program
(TAAJODFC30) will be used in batch instead of the
program that was specified for the Dependent Job.
A message will exist in the job log when testing is
being used and the Master Job record will reflect
that a test was run.
Note that the Test Function program always completes
normally so you cannot test your Dependent Jobs that
are conditioned on a *FAIL condition.
WRKJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to be displayed. The
default is *ALL for all Master Jobs.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
DSPJOBDEPH Parameters *CMD
---------------------
MSTJOB The name of the Master Job to display history for.
*ALL may be specified to see all master jobs.
STRDATE The start date to begin the display. The default is
*ALL for all dates in the file. A specific date may
be entered in job date format.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
PRTJOBDEPH Parameters *CMD
---------------------
MSTJOB The name of the Master Job to print history for.
STRDATE The start date of the Master Job.
STRTIME The start time of the Master Job.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
ENDJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to be ended.
DEPJOB The name of the Dependent Job to end. *NONE is the
default. Any active Dependent Jobs continue (they
are not ended). No new Dependent Jobs will be
submitted.
If a specific Dependent Job name is entered, the
Dependent Job will be ended with OPTION(*CNTRLD).
The job must be on the job queue or active.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
CHKJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to be checked.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
HLDJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to be held. Holding a
Master Job always prevents new Dependent Jobs from
being submitted regardless of the DEPJOB parameter
value.
DEPJOB The name of the Dependent Job to held. *NONE is the
default. Any active Dependent Jobs will continue
processing. Any Dependent Jobs on a job queue may
become active.
*ALL may be entered to hold all Dependent Jobs that
are on a job queue or are active.
A specific Dependent Job name may be entered. The
job will be held. The job must be on the job queue
or active.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
RLSJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to be held.
RLSMST A *YES/*NO parameter for whether the Master Job will
be released. *YES is the default to release the
Master Job. This allows new Dependent Jobs to be
considered for submission. The Master Job must have
been previously held.
*NO may be specified to retain a hold on the Master
Job. This would normally be used if you only want
to release a specific Dependent Job. The Dependent
Job must have been previously held by HLDJOBDEP.
DEPJOB The name of the Dependent Job to be released. *NONE
is the default. This will allow any new Dependent
Jobs to be submitted.
*ALL may be specified to release all Dependent Jobs
that were held by HLDJOBDEP.
A specific Dependent Job name may be entered. The
Dependent Job will be released. The Dependent Job
must be on the job queue or active and must be in a
'held status'.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
SETJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to set a switch for.
SWITCH The switch that has been defined for the Master Job.
It must be a value *SW1 - *SW8.
SETTING How to set the switch. *ON is the default.
*OFF may be specified. The value of a switch after
STRJOBDEP is run is blank (meaning *OFF).
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
MTNJOBDEPH Parameters *CMD
---------------------
RTNDAYS The number of days of history information should be
retained. The default is the last 15 days from the
current date. A value between 0 and 999 may be
entered.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
PRTJOBDEPD Parameters *CMD
---------------------
MSTJOB The name of the Master Job to be printed.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
UPDJOBDEPD Parameters *CMD
---------------------
FRMJOBDEPL The library where the JOBDEP objects exist to be
copied from.
*NONE must be entered if OPTION(*DLT) is specified.
TOJOBDEPL The library where the JOBDEP objects exist to be
added to, updated in, or deleted from. The default
is *LIBL. *CURLIB may be specified.
MSTJOB The name of the Master Job to be added, updated, or
deleted. *ALL is the default meaning that all
Master Jobs in the From Library will be processed.
*ALL may only be used with OPTION(*UPD).
An individual Master Job may be named.
If OPTION(*UPD) is specified and the Master Job to
be processed exists in the To Library, the To
Library records are deleted and the From Library
records are added. If the Master Job does not exist
in the To Library, the new Master Job is added.
If OPTION(*DLT) is specified, a single Master Job
must be named and it is deleted.
Both JOBDEPMSTP and JOBDEPDTLP file records are
considered.
OPTION The type of processing to be performed. The default
is *UPD to update records in the From Library to the
To Library.
*DLT may be entered to delete a single Master Job.
See the discussion with the MSTJOB parameter.
PRTJOBDEP Parameters *CMD
---------------------
MSTJOB The name of the Master Job to be printed.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
RTVJOBDEPD Parameters *CMD
----------------------
MSTJOB The name of the Master Job to retrieve information
for.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
RTNLIB An optional return value for the library for where
the JOBDEP objects exist. This value may be helpful
if a special value is used for the JOBDEPPLIB
parameter. If used, it must be specified as *CHAR
LEN(10).
TEXT An optional return value for the text description of
the Master Job. If used, it must be specified as
*CHAR LEN(50).
USER An optional return value for the user profile used
to run all Dependent Jobs. If used, it must be
specified as *CHAR LEN(10).
JOBD An optional return value for the Job Description to
be used as the default for all Dependent Jobs. If
used, it must be specified as *CHAR LEN(10).
JOBDLIB An optional return for the Job Description library
to be used as the default for all Dependent Jobs.
If used, it must be specified as *CHAR LEN(10).
JOBQ An optional return value for the Job Queue to be
used as the default for all Dependent Jobs. If
used, it must be specified as *CHAR LEN(10).
JOBQLIB An optional return value for the Job Queue library
to be used as the default for all Dependent Jobs.
If used, it must be specified as *CHAR LEN(10).
STATUS An optional return value for the status of the
Master Job. The values returned will be:
Blank - Never been started
*STARTED - Started, but no jobs in process
*PROCESS - In process
*END - Ended
*HELD - Held
If used, it must be specified as *CHAR LEN(10).
STRJOB An optional return value for the Job name that
started the Master Job. If used, it must be
specified as *CHAR LEN(10).
STRUSER An optional return value for the User profile that
started the Master Job. If used, it must be
specified as *CHAR LEN(10).
STRJOBN An optional return value for the Job Number of the
job that started the Master Job. If used, it must
be specified as *CHAR LEN(6).
STRDATE An optional return value for the date when the
Master Job was started. The value is returned in
CYYMMDD format. If used, it must be specified as
*CHAR LEN(7).
STRTIME An optional return value for the time when the
Master Job was started. The value is returned in
HHMMSS format. If used, it must be specified as
*CHAR LEN(6).
ENDFUNC An optional return value for the function that ended
the Master Job. The value returned will describe
how the Master Job was ended"
*DEPJOB - By a Dep Job 'End Master at comp'
*COMPLETE - By all Dep Jobs being completed
*USER - By a user
If used, it must be specified as *CHAR LEN(10).
ENDINFO An optional return value for additional information
about the function that ended the Master Job. The
value returned is dependent on the ENDFUNC value.
*DEPJOB - Name of the Dependent Job
*COMPLETE - Blank
*USER - Name of the user who ran ENDJOBDEP
If used, it must be specified as *CHAR LEN(10).
ENDDATE An optional return value for the date when the
Master Job was ended. The value is returned in
CYYMMDD format. If used, it must be specified as
*CHAR LEN(7).
ENDTIME An optional return value for the time when the
Master Job was ended. The value is returned in
HHMMSS format. If used, it must be specified as
*CHAR LEN(6).
RTVJOBDEP Parameters *CMD
--------------------
MSTJOB The name of the Master Job to retrieve information
for.
DEPJOB The name of the Dependent Job to retrieve
information for.
JOBDEPPLIB The library where the JOBDEP objects exist. The
default is *LIBL. *CURLIB may also be specified.
RTNLIB An optional return value for the library where the
JOBDEP objects exist. This value may be helpful if
a special value is used for the JOBDEPPLIB
parameter. If used, it must be specified as *CHAR
LEN(10).
TEXT An optional return value for the text description of
the Dependent Job. If used, it must be specified as
*CHAR LEN(50).
CMD An optional return value for the command to be run
for the Dependent Job. If used, it must be
specified as *CHAR LEN(100).
JOBD An optional return value for the Job Description to
be used to run the Dependent Job. A name or *MASTER
will be returned. If used, it must be specified as
*CHAR LEN(10).
JOBDLIB An optional return for the Job Description library
to be used to run the Dependent Job. The value will
be blank if *MASTER is returned for JOBD. If used,
it must be specified as *CHAR LEN(10).
JOBQ An optional return value for the Job Queue to be
used to run the Dependent Job. A name or *MASTER
will be returned. If used, it must be specified as
*CHAR LEN(10).
JOBQLIB An optional return value for the Job Queue library
to be used to run the Dependent Job. The value will
be blank if *MASTER is returned for JOBQ. If used,
it must be specified as *CHAR LEN(10).
ENDMST An optional return value for whether the Master Job
is to be considered ended when this Dependent Job
completes. A value of *YES or *NO will be returned.
If used, it must be specified as *CHAR LEN(4).
JOBNBR An optional return value for the Job number of the
Dependent Job if it has been submitted. If used, it
must be specified as *CHAR LEN(6).
MSTDATE An optional return value for the date when the
Master Job was started. The value is returned in
CYYMMDD format. If used, it must be specified as
*CHAR LEN(7).
MSTTIME An optional return value for the time when the
Master Job was started. The value is returned in
HHMMSS format. If used, it must be specified as
*CHAR LEN(6).
SBMDATE An optional return value for the date when the
Dependent Job was submitted. The value is returned
in CYYMMDD format. If used, it must be specified as
*CHAR LEN(7).
SBMTIME An optional return value for the time when the
Dependent Job was submitted. The value is returned
in HHMMSS format. If used, it must be specified as
*CHAR LEN(6).
STRDATE An optional return value for the date when the
Dependent Job was started. The value is returned in
CYYMMDD format. If used, it must be specified as
*CHAR LEN(7).
STRTIME An optional return value for the time when the
Dependent Job was started. The value is returned in
HHMMSS format. If used, it must be specified as
*CHAR LEN(6).
ENDDATE An optional return value for the date when the
Dependent Job was ended. The value is returned in
CYYMMDD format. If used, it must be specified as
*CHAR LEN(7).
ENDTIME An optional return value for the time when the
Dependent Job was ended. The value is returned in
HHMMSS format. If used, it must be specified as
*CHAR LEN(6).
ENDJOBDEP An optional return value for whether the job was
ended by ENDJOBDEP. A value of *YES or *NO will be
returned. If used, it must be specified as *CHAR
LEN(4).
COMPCODE An optional return value for the completion code for
the job. A value of P (*PASS) or F (*FAIL) will be
returned. If used, it must be specified as *CHAR
LEN(1).
Restrictions
------------
None.
Prerequisites
-------------
The following TAA Tools must be on your system:
ADDDAT Add date
ADJVAR Adjust variable
CHKACTOBJ Check active object
CHKJOBCTL Check job control
CHKNAM Check name
CHKOBJ2 Check object 2
CHKOBJ3 Check object 3
CHKOBJTYP Check object type
CVTDAT Convert date
EDTVAR Edit variable
FILEFDBCK File feedback
HLRMVMSG HLL Remove message
RTVAPPVAL Retrieve application value
RTVDAT Retrieve date
RTVDIAGMSG Retrieve diagnostic message
RTVJOBD Retrieve job description
RTVOBJAUT Retrieve object authorization
RTVPGMNAM Retrieve program name
RTVSBMJOB Retrieve submitted job
RTVSYSVAL3 Retrieve system value 3
SCNVARRGT Scan variable right
SNDCOMPMSG Send completion message
SNDDIAGMSG Send diagnostic message
SNDESCMSG Send escape message
SNDJLGMSG Send job log message
SNDSTSMSG Send status message
TAAARC TAA Archive
UPDPFILE Update PFILE keyword
Implementation
--------------
None, the tool is ready to use.
Major Data Base files
---------------------
Source Type File in Library Key Field
------ ---- ---------------- ---------
TAAJODFP PF JOBDEPMSTP JMMST
TAAJODFQ PF JOBDEPDTLP JLMST, JLJOB
TAAJODFU PF JOBDEPHSMP JMMST, JMSTRD, JMSTRT
TAAJODFV PF JOBDEPHSDP JLMST, JLJOB, JLSTRD, JLSTRT
TAAJODFL LF JOBDEPMSTL Arrival over JOBDEPMSTP
TAAJODFM LF JOBDEPDTLL Arrival over JOBDEPDTLP
TAAJODFW LF JOBDEPHSML Arrival over JOBDEPHSMP
TAAJODFX LF JOBDEPHSDL Arrival over JOBDEPHSDP
Other Data Base files in TAATOOL
--------------------------------
TAAJODFA PF Test data for Master file
TAAJODFB PF Test data for Detail file
TAAJODFS PF Duplicate of TAAJODFP used by UPDJOBDEPD
TAAJODFT PF Duplicate of TAAJODFQ used by UPDJOBDEPD
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CRTJOBDEPD *CMD TAAJODF QATTCMD
DLTJOBDEPD *CMD TAAJODF2 QATTCMD
WRKJOBDEPD *CMD TAAJODF3 QATTCMD
STRJOBDEP *CMD TAAJODF4 QATTCMD
ENDJOBDEP *CMD TAAJODF5 QATTCMD
CHKJOBDEP *CMD TAAJODF6 QATTCMD
SETJOBDEP *CMD TAAJODF7 QATTCMD
HLDJOBDEP *CMD TAAJODF8 QATTCMD
RLSJOBDEP *CMD TAAJODF9 QATTCMD
WRKJOBDEP *CMD TAAJODF10 QATTCMD
MTNJOBDEPH *CMD TAAJODF11 QATTCMD
DSPJOBDEPH *CMD TAAJODF13 QATTCMD
RTVJOBDEPD *CMD TAAJODF14 QATTCMD
RTVJOBDEP *CMD TAAJODF15 QATTCMD
PRTJOBDEPD *CMD TAAJODF16 QATTCMD
PRTJOBDEP *CMD TAAJODF17 QATTCMD
PRTJOBDEPH *CMD TAAJODF18 QATTCMD
UPDJOBDEPD *CMD TAAJODF19 QATTCMD
TAAJODFC *PGM CLP TAAJODFC QATTCL
TAAJODFC2 *PGM CLP TAAJODFC2 QATTCL
TAAJODFC3 *PGM CLP TAAJODFC3 QATTCL
TAAJODFC4 *PGM CLP TAAJODFC4 QATTCL
TAAJODFC5 *PGM CLP TAAJODFC5 QATTCL
TAAJODFC6 *PGM CLP TAAJODFC6 QATTCL
TAAJODFC7 *PGM CLP TAAJODFC7 QATTCL
TAAJODFC8 *PGM CLP TAAJODFC8 QATTCL
TAAJODFC9 *PGM CLP TAAJODFC9 QATTCL
Objects used by the tool - Continued
------------------------------------
TAAJODFC10 *PGM CLP TAAJODFC10 QATTCL
TAAJODFC11 *PGM CLP TAAJODFC11 QATTCL
TAAJODFC13 *PGM CLP TAAJODFC13 QATTCL
TAAJODFC14 *PGM CLP TAAJODFC14 QATTCL
TAAJODFC15 *PGM CLP TAAJODFC15 QATTCL
TAAJODFC16 *PGM CLP TAAJODFC16 QATTCL
TAAJODFC17 *PGM CLP TAAJODFC17 QATTCL
TAAJODFC18 *PGM CLP TAAJODFC18 QATTCL
TAAJODFC19 *PGM CLP TAAJODFC19 QATTCL
TAAJODFC23 *PGM CLP TAAJODFC23 QATTCL
TAAJODFC24 *PGM CLP TAAJODFC24 QATTCL
TAAJODFC25 *PGM CLP TAAJODFC25 QATTCL
TAAJODFC27 *PGM CLP TAAJODFC27 QATTCL
TAAJODFC30 *PGM CLP TAAJODFC30 QATTCL
TAAJODFC33 *PGM CLP TAAJODFC33 QATTCL
TAAJODFC34 *PGM CLP TAAJODFC34 QATTCL
TAAJODFC35 *PGM CLP TAAJODFC35 QATTCL
TAAJODFC36 *PGM CLP TAAJODFC36 QATTCL
TAAJODFC37 *PGM CLP TAAJODFC37 QATTCL
TAAJODFC38 *PGM CLP TAAJODFC38 QATTCL
TAAJODFC39 *PGM CLP TAAJODFC39 QATTCL
TAAJODFC40 *PGM CLP TAAJODFC40 QATTCL
TAAJODFC90 *PGM CLP TAAJODFC90 QATTCL
TAAJODFC99 *PGM CLP TAAJODFC99 QATTCL
TAAJODFR3 *PGM RPG TAAJODFR3 QATTRPG
TAAJODFR4 *PGM RPG TAAJODFR4 QATTRPG
TAAJODFR5 *PGM RPG TAAJODFR5 QATTRPG
TAAJODFR7 *PGM RPG TAAJODFR7 QATTRPG
TAAJODFR8 *PGM RPG TAAJODFR8 QATTRPG
TAAJODFR9 *PGM RPG TAAJODFR9 QATTRPG
TAAJODFR10 *PGM RPG TAAJODFR10 QATTRPG
TAAJODFR13 *PGM RPG TAAJODFR13 QATTRPG
TAAJODFR14 *PGM RPG TAAJODFR14 QATTRPG
TAAJODFR15 *PGM RPG TAAJODFR15 QATTRPG
TAAJODFR16 *PGM RPG TAAJODFR16 QATTRPG
TAAJODFR17 *PGM RPG TAAJODFR17 QATTRPG
TAAJODFR18 *PGM RPG TAAJODFR18 QATTRPG
TAAJODFR19 *PGM RPG TAAJODFR19 QATTRPG
TAAJODFR23 *PGM RPG TAAJODFR23 QATTRPG
TAAJODFR24 *PGM RPG TAAJODFR24 QATTRPG
TAAJODFR25 *PGM RPG TAAJODFR25 QATTRPG
TAAJODFR30 *PGM RPG TAAJODFR30 QATTRPG
TAAJODFR33 *PGM RPG TAAJODFR33 QATTRPG
TAAJODFR45 *PGM RPG TAAJODFR45 QATTRPG
Objects used by the tool - Continued
------------------------------------
TAAJODFD *FILE DSPF TAAJODFD QATTDDS
TAAJODFE *FILE DSPF TAAJODFE QATTDDS
TAAJODFF *FILE DSPF TAAJODFF QATTDDS
TAAJODFG *FILE DSPF TAAJODFG QATTDDS
TAAJODFH *FILE DSPF TAAJODFH QATTDDS
TAAJODFI *FILE DSPF TAAJODFI QATTDDS
TAAJODFA *FILE PF
TAAJODFB *FILE PF
TAAJODFQ *FILE PF TAAJODFQ QATTDDS
TAAJODFU *FILE PF TAAJODFU QATTDDS
TAAJODFV *FILE PF TAAJODFV QATTDDS
TAAJODFL *FILE LF TAAJODFL QATTDDS
TAAJODFM *FILE LF TAAJODFM QATTDDS
TAAJODFS *FILE PF TAAJODFP QATTDDS
TAAJODFT *FILE PF TAAJODFQ QATTDDS
TAAJODFW *FILE LF TAAJODFW QATTDDS
TAAJODFX *FILE LF TAAJODFX QATTDDS
TAAJOBDEP *DTAARA
JOBDEP *USRSPC
TAAJODFA and TAAJODFB contain the test data used for the demo (See
program TAAJODFC90).
TAAJODFS and TAAJODFT are duplicates of TAAJODFP and TAAJODFQ.
The TAAJOBDEP data area is in the same library as the user files
created by CRTJOBDEPD.
The JOBDEP user space is in TAASECURE and works with the STRJOBDEP
command to provide the values for MTNJOBDEPH.
Structure
---------
GO JOBDEP - The menu is created by CRTMNU TYPE(*PGM)
TAAJODFC40 CL pgm
TAAJODFI Display file
CRTJOBDEPD Cmd
TAAJODFC CL pgm
DLTJOBDEPD Cmd
TAAJODFC2 CL pgm
WRKJOBDEPD Cmd
TAAJODFC3 CL pgm
TAAJODFR3 RPG Pgm for Master record
TAAJODFD Display file for Master record
TAAJODFC23 CL Pgm to check CL functions (eg *JOBD exist)
TAAJODFR23 RPG Pgm for Detail record
TAAJODFE Display file for Detail record
TAAJODFC23 CL Pgm to check CL functions (eg *JOBD exist)
TAAJODFC35 CL Pgm to check Command syntax with QCMDCHK
TAAJODFR33 RPG Pgm to fill DEP array of Dependent Jobs
TAAJODFR25 RPG Pgm to delete detail records
STRJOBDEP Cmd
TAAJODFC4 CL pgm
TAAJODFR4 RPG pgm
TAAJODFC24 CL Pgm - Controlling pgm to check for SBM
Also does MTNJOBDEPH if needed
TAAJODFR24 RPG Pgm to check for Dependent Jobs to submit
TAAJODFC33 CL Pgm to check object existence
TAAJODFC34 CL Pgm to do SBMJOB of TAAJODFC99
In batch
TAAJODFC99 CL Pgm which is submitted to batch
TAAJODFC30 CL Pgm for STRJOBDEP test function
TAAJODFR45 RPG Pgm to update start and end of job
TAAJODFC25 CL Pgm - Copy to history
TAAJODFC24 CL Pgm - Controlling pgm to check for SBM
Same as above
ENDJOBDEP Cmd
TAAJODFC5 CL pgm
TAAJODFR5 RPG pgm
TAAJODFC25 CL pgm - Copies to history
TAAJODFC36 CL pgm - Ends Dependent Job
Structure - Continued
---------------------
CHKJOBDEP Cmd
TAAJODFC6 CL pgm
TAAJODFR5 RPG pgm - Same as END
TAAJODFC24 CL Pgm - Controlling pgm to check for SBM
Same as above
SETJOBDEP Cmd
TAAJODFC7 CL pgm
TAAJODFR7 RPG pgm - Updates Master switch info
TAAJODFC24 CL Pgm - Controlling pgm to check for SBM
Same as above
HLDJOBDEP Cmd
TAAJODFC8 CL pgm
TAAJODFR8 RPG pgm - Updates Master
TAAJODFC38 CL Pgm - Does HLDJOB
RLSJOBDEP Cmd
TAAJODFC9 CL pgm
TAAJODFR9 RPG pgm - Updates Master
TAAJODFC39 CL Pgm - Does RLSJOB
WRKJOBDEP Cmd
TAAJODFC10 CL pgm
TAAJODFR10 RPG Pgm for Master record
TAAJODFF Display file for Master record
TAAJODFC37 CL Pgm to run commands like STRJOBDEP
TAAJODFR30 RPG Pgm for Detail record
TAAJODFG Display file for Detail record
DSPJOBDEPH Cmd
TAAJODFC13 CL pgm
TAAJODFR13 RPG Pgm for Master record
TAAJODF3 Display file for Master record
TAAJODFR10 RPG pgm as described previously
TAAJODFR30 RPG pgm as described previously
MTNJOBDEPH Cmd
TAAJODFC11 CL pgm
Structure - Continued
---------------------
PRTJOBDEPD Cmd
TAAJODFC16 CL pgm
TAAJODFR16 RPG Pgm
TAAJODFC17 CL Pgm
PRTJOBDEP Cmd
TAAJODFC17 CL pgm
TAAJODFR17 RPG Pgm
PRTJOBDEPH Cmd
TAAJODFC18 CL pgm
TAAJODFR18 RPG Pgm
RTVJOBDEPD Cmd
TAAJODFC14 CL pgm
TAAJODFR14 RPG Pgm
RTVJOBDEP Cmd
TAAJODFC15 CL pgm
TAAJODFR15 RPG Pgm
UPDJOBDEPD Cmd
TAAJODFC19 CL pgm
TAAJODFR19 RPG Pgm
|