TAA Tools
JOBDEP2         JOB DEPENDENT TOOL DEMONSTRATION

This  documentation  provides  a  demonstration   of  the  JOBDEP  (Job
Dependency) tool.

As you  go thru the  demonstration, it is  recommended that you  do not
change  any of the definitions  of the test data.   This will allow the
test scenario to be run properly.

Once you have  completed the demonstration, you  may modify any of  the
provided  entries to  help your  understanding of  the tool.    You can
return  to the  original  test data  by clearing  the test  library and
starting the steps again.

Creating the Demonstration Library and Objects
----------------------------------------------

  **   Create a specific  test library  such as TSTJOBDEP  and add  the
       library to your library list.

            CRTLIB      LIB(TSTJOBDEP)
            ADDLIBLE    LIB(TSTJOBDEP)

       It is not  a requirement to use the TSTJOBDEP  library name, but
       all  of the following steps  will assume that name  and that the
       library is on the library list.

  **   Create the required objects in the TSTJOBDEP library.

            CRTJOBDEPD  JOBDEPLIB(TSTJOBDEP)

  **   CRTJOBDEPD creates several files  and a data  area in the  named
       library.  Review these with:

            DSPLIB      LIB(TSTJOBDEP)

Copying the Test Data
---------------------

  **   The test  data defines  Master and  Dependent Jobs.   There  are
       three  master jobs  defined  which  will allow  you  to exercise
       many of the options of the Job Dependent tool.

         BILLING    Has dependent jobs based on successful completion
         ORDERS     Has a dependent job based on a switch setting
         PAYABLES   Has a dependent job based on an object existing

  **   Call  the  program  that  copies the  test  data  from  files in
       TAATOOL and name the test library.

            CALL        PGM(TAAJODFC90) PARM(TSTJOBDEP)

WRKJOBDEPD Command for Working with Job Dependent Descriptions
--------------------------------------------------------------

  **   The  WRKJOBDEPD  command   allows  creating  and   changing  the
       descriptions for the JOBDEP tool.  Enter:

            WRKJOBDEPD

  **   You should see:

**********************************************************************
*                                                                    *
*                           Work Dependent Jobs Dsc TAA          ... *
*                                                                    *
*   Position to master . . .  BILLING___         Library for MST ... *
*                                                                    *
*   Type options, press Enter.                                       *
*     2=Change   3=Copy   4=Delete   5=Display   7=Rename   8=Print  *
*     9=Dependent jobs                                               *
*                                                                    *
*   Opt  Master name  Text                                           *
*    _   BILLING      The BILLING test - Dependent Job completion    *
*    _   ORDERS       The ORDERS test - Switch setting               *
*    _   PAYABLES     The PAYABLES test - Object Existence test      *
*                                                                    *
*   F3=Exit    F6=Add mode    F12=Cancel                             *
**********************************************************************

  **   This  is  the main  display  with  the  three test  Master  Jobs
       already  defined.   The display  allows the typical  options for
       creating and maintaining the descriptions.

  **   Use the '2 = Change' option for BILLING.  You should see:

**********************************************************************
*                                                                    *
*         Work Dependent Jobs Dsc TAA  - Change to Master Job    ... *
*                                                                    *
*   Master name . . . . . . :   BILLING                  Name        *
*   Text  . . . . . . . . . :   The BILLING test - Dependent Job ... *
*   User profile. . . . . . :   XXXXX____                Name        *
*   Job description . . . . :   QDFTJOBD_                Name        *
*     Library . . . . . . . :     QGPL___                Name        *
*   Job queue . . . . . . . :   QINTER___                Name        *
*     Library . . . . . . . :     QGPL_____              Name        *
*                                                                    *
*             Rollup for defining dependent switches.                *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit     F6=Display JOBD     F5=Refresh      F12=Cancel       *
**********************************************************************

       The detail display allows entries for:

            Master job name and a text description
            User profile name to run all work for
            Job description and library
            Job queue and library

  **   The Master job name is  not a 'job name' to  the system.  It  is
       only a  controlling entity.   The  Master Job  name is the  high
       order  key to the  detail Dependent  Job records.   The commands
       that operate on a  Dependent Job will require  you to enter  the
       Master Job name.

  **   The Job  Description will be  the default for  all work for  the
       Master  Job.   QDFTJOBD  in  QGPL is  assigned.   An  individual
       Dependent Job may have a unique Job Description.

  **   The  Job Queue will be  the default for all  work for the Master
       Job.  QINTER in  QGPL is assigned.   This will allow the  simple
       test programs to  run in batch as if  they were interactive jobs
       (you   should  see   negligible   performance  impact   on  your
       interactive work).  QINTER is  not recommended for normal  batch
       work.

       An individual Dependent Job may have a unique Job Queue.

  **   The  user profile  name must  be  changed.   Enter your  profile
       name.   When entering a profile name, any  name may be used, but
       the user  who  defines  the  entry must  be  authorized  to  the
       profile.

  **   Press Enter  to return  to the  main display.   Enter  the '2  =
       Change'  option for both  the ORDERS  and PAYABLES  Master Jobs.
       Change  the User  profile name for  both ORDERS  and PAYABLES as
       you did for BILLING.

       After Enter is  pressed for PAYABLES,  you should return to  the
       main WRKJOBDEPD display.

  **   The  test  data for  the  Master job  named  BILLING  has has  3
       Dependent Jobs:

            BILLING1      - Runs without any dependencies
            BILLING2      - Runs if BILLING1 completes successfully
            BILLING3      - Runs if both BILLING1 and BILLING2
                               complete successfully

  **   Enter the '9 = Dependent jobs' option for BILLING.

       The 3 BILLING Dependent Jobs are shown as:

**********************************************************************
*                                                                    *
*                             Work Dependent Jobs TAA            ... *
*                                                                    *
*   Position to dependent job . . .  BILLING1_           Master  ... *
*                                                                    *
*   Type options, press Enter.                                       *
*     2=Change   3=Copy   4=Delete   5=Display   7=Rename            *
*                                                                    *
*   Opt  Dep Job      Text or Command                                *
*    _   BILLING1     The standard test program                      *
*    _   BILLING2     The standard test program                      *
*    _   BILLING3     The standard test program                      *
*                                                                    *
*   F3=Exit    F6=Add mode    F12=Cancel                             *
**********************************************************************

  **   Use  the   '2  =  Change'  option  to  display  the  details  of
       BILLING1, BILLING2, and BILLING3.

  **   The Dependent  Job  BILLING1  is  displayed first.    It  should
       appear as:

**********************************************************************
*                                                                    *
*      Work Job Dependent Jobs - Dependent Jobs                  ... *
*                                                                    *
*   Master job  . . . . . . :   BILLING                              *
*   Dependent job . . . . . :   BILLING1_                Name        *
*   Command to submit . . . :   CALL PGM(TAAJODFC30)_____________... *
* __________________________________________________                 *
*   Text  . . . . . . . . . :   The standard test program________... *
*   Job description . . . . :   *MASTER___               Name        *
*     Library . . . . . . . :     __________             Name        *
*   Job queue . . . . . . . :   *MASTER___               Name        *
*     Library . . . . . . . :     __________             Name        *
*   End Master at completion:   *NO_                     *YES, *NO   *
*                                                                    *
*             Rollup for dependencies.                               *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit     F5=Refresh     F12=Cancel                            *
**********************************************************************

       Each Dependent Job allows entries for:

            Dependent Job name
            Command to be run
            An optional text description
            An optional Job Description which defaults to *MASTER
            An optional Job Queue which defaults to *MASTER
            An entry that describes whether to end the Master job

       The  command  entered is  a  CALL  to  a standard  test  program
       (TAAJODFC30).   You can  name any command.   You can  prompt for
       the command parameters with F4.

       Both the Job Description  and Job Queue  entries default to  the
       Master Job values.

       The  'End  Master  at  completion'  entry  determines  when  the
       Master  Job will  be  considered complete.   Since  this  is the
       first of several Dependent Jobs, *NO is used.

  **   Use  Rollup  for dependencies.    BILLING1 has  no dependencies.
       It should run  whenever the Master Job  is started.  The  screen
       appears as:

**********************************************************************
*                                                                    *
*            Work Job Dependent Description - Dependent Jobs     ... *
*                                                                    *
*   Master job  . :  BILLING     The BILLING test - Dependent Jo ... *
*                                                                    *
*   Dependent job :  BILLING1    The standard test program           *
*                                                                    *
*   Cmd to submit :  CALL PGM(TAAJODFC30)                            *
*                                                                    *
*   And/Or   Function    Condition    Text description               *
*                                                                    *
*            _________   __________   ____________________________   *
*   *AND     _________   __________   ____________________________   *
*    ..                                                              *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

  **   Press  Enter  to display  the  details  of  BILLING2.   BILLING2
       looks  similar  to BILLING1.    A different  command  could have
       been entered.

  **   Use Rollup to see the dependencies.

       The screen appears as:

**********************************************************************
*                                                                    *
*            Work Job Dependent Description - Dependent Jobs     ... *
*                                                                    *
*   Master job  . :  BILLING     The BILLING test - Dependent Jo ... *
*                                                                    *
*   Dependent job :  BILLING2    The standard test program           *
*                                                                    *
*   Cmd to submit :  CALL PGM(TAAJODFC30)                            *
*                                                                    *
*   And/Or   Function    Condition    Text description               *
*                                                                    *
*            BILLING1_   *PASS_____   BILLING1 must complete nor ... *
*   *AND     _________   __________   ______________________________ *
*    ..                                                              *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

       BILLING2 will not  be run  until the 'Function'  BILLING1 has  a
       condition of *PASS  meaning that the BILLING1  job has completed
       normally.

       The 'Function' field allows for:

          - A Dependent Job name
          - A named switch to test for *ON or *OFF (described later)
          - An object existence test (described later)

       The  most common  Function is  for  a Dependent  Job name.   The
       'Condition' entry  for a  Dependent  Job describes  whether  the
       condition is met by:

          - *PASS  The job completed normally
          - *FAIL  The job completed abnormally
          - *END   The job completed either normally or abnormally

       A text description is optional for each Function entered.

  **   Press Enter to see BILLING3.

       It is  similar to BILLING1  and BILLING2  except that the  entry
       for  'End Master  at  completion' is  specified as  *YES.   This
       means  the  Master  Job  will be  considered  to  be  ended when
       BILLING3 completes (either normally or abnormally).

  **   Use  Rollup for  the  dependencies  for BILLING3.    The  screen
       appears as:

**********************************************************************
*                                                                    *
*      Work Job Dependent Description - Dependent Jobs - TAA     ... *
*                                                                    *
*   Master job  . :  BILLING     The BILLING test - Dependent Jo ... *
*                                                                    *
*   Dependent job :  BILLING3    The standard test program           *
*                                                                    *
*   Cmd to submit :  CALL PGM(TAAJODFC30)                            *
*                                                                    *
*   And/Or   Function    Condition    Text description               *
*                                                                    *
*            BILLING1__  *PASS_____   _____________________________  *
*   *AND     BILLING2__  *PASS_____   _____________________________  *
*   *AND     __________  __________   _____________________________  *
*    ..                                                              *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

       Two  dependencies are shown.   Both  BILLING1 and  BILLING2 must
       complete  normally.   They are  in an  '*AND' relationship.   An
       *OR could  be  entered  or  combination  *AND/*OR  relationships
       (see the  tool documentation  on 'Using  Multiple Functions  and
       Conditions).  A limit of 9 dependencies exist

       In  this example,  it would be  possible to  have only  a single
       dependency for BILLING3 to be  conditioned to run when  BILLING2
       completes  normally.   However,  you could  decide  to run  both
       BILLING1 and  BILLING2 simultaneously either  thru different job
       queues  or a single job queue  that allows multiple active jobs.

  **   Use F3 until you return to a command line.

Starting the BILLING Job and Reviewing Job Logs
-----------------------------------------------

  **   To start the BILLING Master Job, use the STRJOBDEP command:

            STRJOBDEP   MSTJOB(BILLING)

  **   Starting BILLING  causes BILLING1  to be  submitted because  the
       job has  no dependencies.  When BILLING1  completes, BILLING2 is
       submitted.   When both BILLING1  and BILLING2 complete, BILLING3
       is submitted.  The normal  'job completed' message will be  sent
       for each Dependent Job as it completes.

  **   The test program  (TAAJODFC30) causes a job log  so there should
       be unique job logs for each of the Dependent Jobs.

  **   Use  WRKSPLF and the '5  = Display' option to  look at the first
       job log (USRDTA = BILLING1).

  **   The name of the job is the Dependent Job name BILLING1.

  **   You should  see a  'Request message'  for the  command that  was
       submitted to batch.   The JOBDEP tool always  submits TAAJODFC99
       as the program  to be run.  Your command  to be run is described
       as  a  parameter  to  the  TAAJODFC99  program.    In  the  test
       example, the command is CALL PGM(TAATOOL/TAAJODFC30).

       TAAJODFC99 program  remains  at the  top  of the  program  stack
       until  the   Dependent  Job   command  completes.     TAAJODFC99
       monitors  for  all errors  and  sends  messages to  the  job log
       whether the  real  command  completed  normally  or  abnormally.
       The  Dependent  Job  record  is   updated  with  the  completion
       information.

       TAAJODFC99  then calls  another JOBDEP  program to  determine if
       any Dependent  Jobs should  be submitted.   Since  BILLING1  has
       completed  normally,  the  *PASS  condition   is  satisfied  and
       BILLING2  is submitted.    A message  in the  job  log indicates
       this  as well  as a summary  message stating how  many jobs were
       submitted.

       The BILLING2  job log  is similar  to BILLING1,  but contains  a
       message stating that BILLING3 was submitted.

       The BILLING3  job log  is also similar  to BILLING1  except that
       no  jobs were submitted when  BILLING3 ended.   You should see a
       message stating that  the Master Job  BILLING has completed  all
       Dependent Jobs  based on  the 'End Master  if completed'  = *YES
       entry specified for BILLING3.

       Note  that  if  the command  to  be  run  fails, the  TAAJODFC99
       program  will  monitor  for  the  error  and  continue  to  run.
       TAAJODFC99  updates  the  Dependent Job  as  having  failed  and
       determines  if new  work should  be submitted.   If  the command
       failed,  TAAJODFC99  ends by  sending an  escape message  at the
       end  of  the  program.    This  causes  the  job  to  abnormally
       terminate and  the completion code  for the job (in  the CPF1164
       message) will indicate a failure.

       The  test program is specified  to produce a job  log so you can
       see  the   results.     Your   application  code   (and/or   Job
       Description) will  control whether  a job log  is produced  if a
       normal  completion  occurs.    If  your  application fails,  the
       TAAJODFC99 program will cause  a job log  by sending the  escape
       message.

Using WRKJOBDEP
---------------

  **   There are two WRK commands:

             WRKJOBDEPD   - Operates on descriptions
             WRKJOBDEP    - Provides status and other options

       Once  you have  entered the  descriptions  with WRKJOBDEPD,  the
       WRKJOBDEP command should be used.

  **   Enter  WRKJOBDEP   (not  WRKJOBDEPD)  to   display  the  BILLING
       results.

             WRKJOBDEP   MSTJOB(BILLING)

  **   The screen appears as:

**********************************************************************
*                                                                    *
*                     Work Job Dependent TAA                     ... *
*                                                                    *
*   Position to master job . . .  BILLING___     Library for MST ... *
*                                                                    *
*   Type options, press Enter.                                       *
*     1=Start    2=End    3=Hold    5=Display    6=Release   8=Check *
*     8=Print    9=Dependent jobs                                    *
*                                  Text                              *
*   Opt  Master name  Status                                         *
*    _   BILLING      *END         The BILLING test - Dependent  ... *
*                                                                    *
*   F3=Exit    F12=Cancel                                            *
**********************************************************************

       The  status appears  as *END  meaning the  Master Job  has ended
       (no more Dependent Jobs will be run).

       Note that  you can  also start,  end, hold,  release, check  and
       print a  Master Job  from this display.   Each of  these options
       is   also  a   command.     The  options  for   '5=Display'  and
       '9=Dependent Jobs'  are  interactive functions  limited  to  the
       display.

  **   Use the '5  = Display' option to display the  information in the
       Master record.

       The screen appears as:

**********************************************************************
*                                                                    *
*                   Work Job Dependent TAA - Master Record       ... *
*                                                                    *
*   Master job  . . . . . . :   BILLING                              *
*   Text  . . . . . . . . . :   The BILLING test - Dependent Job ... *
*   User profile to submit  :   SLOAN                                *
*   Job description . . . . :   QDFTJOBD    in   QGPL                *
*   Job queue . . . . . . . :   QINTER      in   QGPL                *
*   Status  . . . . . . . . :   *END                                 *
*     Function if Sts=*END  :   *DEPJOB    End information: BILLING3 *
*   Test function . . . . . :   *NO                                  *
*   Start job . . . . . . . :   DSP01       User:   SLOAN        ... *
*   Start date  . . . . . . :   12/06/09   at   15:06:58             *
*   End date  . . . . . . . :   12/06/09   at   15:06:59             *
*   Change def user . . . . :   SLOAN                                *
*   Change def date . . . . :   12/06/09   at   14:41:32             *
*                                                                    *
*             Rollup for dependent switches.                         *
*                                                                    *
*   F3=Exit     F12=Cancel     Press Enter to continue.              *
**********************************************************************

       The Master  Job is in an *END  status because *DEPJOB (meaning a
       Dependent Job)  caused the  Master Job  to end.   The  Dependent
       Job that  caused it to  end was BILLING3.   This was  the option
       specified on  WRKJOBDEPD for 'End  Master if completed'  = *YES.

       The other information includes:

          - The job that started the Master Job
          - The start and end date/time information
          - The user who made the last change to the definition
          - The date and time of the last change to the definition

  **   Use F3 to return to the main display.

  **   Use  the '9 =  Dependent Jobs' option  to see the  status of the
       Dependent Jobs.

       The screen appears as:

**********************************************************************
*                                                                    *
*                             Work Job Dependent - TAA           ... *
*                                                                    *
*   Position to dependent job . . . __________           Master  ... *
*                                                                    *
*   Type options, press Enter.                                       *
*     5=Display                                                      *
*                                                                    *
*   Opt  Dep job      Status       Text or Command                   *
*    _   BILLING1     *PASS        The standard test program         *
*    _   BILLING2     *PASS        The standard test program         *
*    _   BILLING3     *PASS        The standard test program         *
*                                                                    *
*   F3=Exit    F12=Cancel                                            *
**********************************************************************

       Each of  the  Dependent Jobs  shows a  status  of *PASS  meaning
       they have all completed normally.

  **   Use the '5  = Display' option to display  the detail information
       for BILLING1.

       The screen appears as:

**********************************************************************
*                                                                    *
*                Work Job Dependent - TAA - Dependent Job Record ... *
*                                                                    *
*   Master job  . . . . . . :   BILLING                              *
*   Dependent job . . . . . :   BILLING1                             *
*   Command to submit . . . :   CALL PGM(TAAJODFC30)                 *
*                                                                    *
*   Text descrp of job  . . :   The standard test program            *
*   Job description . . . . :   *MASTER                              *
*   Job queue . . . . . . . :   *MASTER                              *
*   Qualified job name  . . :   053369/SLOAN/BILLING1                *
*   End master if completed :   *NO                                  *
*   Master job start date . :   12/06/09  at   15:06:58              *
*   Submit date . . . . . . :   12/06/09  at   15:06:58              *
*   Start date  . . . . . . :   12/06/09  at   15:06:58              *
*   End date  . . . . . . . :   12/06/09  at   15:06:58              *
*   Completion code . . . . :   P = *PASS                            *
*   Number of dependencies  :   0                                    *
*   Change def user . . . . :   SLOAN                                *
*   Change def date . . . . :   12/06/09  at   1:45:333              *
*             No dependencies exist                                  *
*                                                                    *
*   F3=Exit     F12=Cancel     Press Enter to continue.              *
**********************************************************************

       The information includes:

          - The qualified job name of the job when submitted
          - The submit date and time
          - The start date and time
          - The end date and time
          - The completion code
          - The user who made the last change to the definition
          - The date and time of the last change to the definition

  **   Use F3 until you return to a command line.

Job Dependent History Information
---------------------------------

  **   Enter another Start command for BILLING as:

            STRJOBDEP   MSTJOB(BILLING)

  **   Each  time  a  Master Job  completes,  the  information  for the
       Master its  Dependent Jobs  is  copied to  history files.    The
       history files were  created by CRTJOBDEPD.   Display the history
       with:

            DSPJOBDEPH  MSTJOB(BILLING)

       The screen appears as:

**********************************************************************
*                                                                    *
*                   Display Job Dependent History - TAA          ... *
*                                                                    *
*                Position to Start Date . . .  1091206  Use CYMD ... *
*                                                                    *
*   Text:  The BILLING test - Dependent Job completion               *
*                                                                    *
*   Type options, press Enter.                                       *
*     5=Display    8=Print    9=Dependent jobs                       *
*                                                                    *
*   Opt  Master       Str date   Str time   End date   End time      *
*    -   BILLING      12/06/09   15:06:58   12/06/09   15:06:59      *
*    -   BILLING      12/06/09   15:15:50   12/06/09   15:15:52      *
*                                                                    *
*   F3=Exit    F12=Cancel                                            *
**********************************************************************

       You  should see  two BILLING  Master  Jobs have  been completed.
       The start date and time are the keys to the information.

       WRKJOBDEP displays the current information  for the job once  it
       is started.  When  the job completes, the information  is copied
       to  the history  files.   The current  information is  not reset
       until  STRJOBDEP  is  used.    DSPJOBDEPH  displays  the history
       information of completed jobs.

  **   Use the '5 =  Display' option for the  first BILLING job.   This
       should  display  the  same   information  you  saw  before  with
       WRKJOBDEP.

  **   Return  to the  main display  and use the  '9 =  Dependent jobs'
       option.   This should  be the  same information  you saw  before
       with WRKJOBDEP.

       The history files  need to be maintained  periodically to delete
       old  history.   Both  a  command (MTNJOBDEPH)  and  an automatic
       function exist  to  perform  the  maintenance.    The  automatic
       function is  the default and  will occur every  few days on  the
       first   use  of   STRJOBDEP  for   the  day.     See   the  tool
       documentation   section   on   'History   Information   and  the
       MTNJOBDEPH command'.

  **   Use F3 until you return to a command line.

ORDERS Dependent Job which uses a Dependent Switch
--------------------------------------------------

  **   The next test  is for the  ORDERS Master Job.   It conditions  a
       dependent job on a switch being set.

  **   Enter:

             WRKJOBDEPD

  **   Use the '2 = Change' option for ORDERS.

  **   Rollup for the Change Switches display.

       The screen appears as:

**********************************************************************
*                                                                    *
*         Work Dependent Jobs Dsc TAA  - Change Switches         ... *
*                                                                    *
*   Master name:   ORDERS       The ORDERS test - Switch setting     *
*                                                                    *
*                                                                    *
*   Enter a description for each switch that will be set by SETD ... *
*                                                                    *
*                                                                    *
*   *SW1   Switch 1 to be set by a job outside of ORDERS____         *
*   *SW2   -------------------------------------------------         *
*   *SW3   -------------------------------------------------         *
*    ..                                                              *
*                                                                    *
*      Rollup for objects which can be tested for existence.         *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

       Switch  1 (*SW1)  has a  description.   Providing  a description
       defines  that  the  switch  can  be  used  as  a  Function in  a
       Dependent Job.  You can define  up to 8 switches.  Switches  are
       unique within a Master Job.

       A switch  can be set by  any job.   It could be a  Dependent Job
       within the  same Master Job, from a  different Master Job, or it
       could be from a job outside of the JOBDEP tool.

       Switches can only be  set while the Master  Job has a status  of
       *PROCESS.  All switches  are reset to blank (meaning  *OFF) when
       STRJOBDEP is used.

  **   Return  to the  main display and  use the  '9 =  Dependent jobs'
       option for ORDERS.

  **   Use  the  '2  = Change'  option  to review  both  Dependent Jobs
       (ORDERS1 and ORDERS2).

  **   Use Rollup  when the  ORDERS1 record  appears.   ORDERS1 has  no
       dependencies.

  **   Press Enter.

  **   The ORDERS2 record should be displayed.  Use Rollup.

  **   ORDERS2 has two dependencies and the screen appears as:

**********************************************************************
*                                                                    *
*            Work Job Dependent Description - Dependent Jobs - TAA   *
*                                                                    *
*   Master job  . :  ORDERS      The ORDERS test - Switch setting    *
*                                                                    *
*   Dependent job :  ORDERS2                                         *
*                                                                    *
*   Cmd to submit :  CALL PGM(TAAJODFC30)                            *
*                                                                    *
*   And/Or   Function    Condition    Text description               *
*                                                                    *
*            ORDERS1___  *PASS_____   ______________________________ *
*   *AND     *SW1______  *ON_______   Set by a job outside of ORDERS *
*   *AND     __________  __________   ______________________________ *
*    ..                                                              *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

  **   ORDERS1 must  have completed normally  (*PASS) and *SW1  must be
       *ON for ORDERS2 to be submitted.

  **   Use F3 until you return to a command line.

  **   Enter the command to start the ORDERS Master Job with:

             STRJOBDEP     MSTJOB(ORDERS)

  **   You  should see ORDERS1 complete.   ORDERS2 will not start until
       *SW1 is set.

  **   Review the status of ORDERS by entering:

             WRKJOBDEP

  **   You  should see  that  ORDERS  has  a  status  of  *PROCESS  (in
       process).

  **   Use the '9 = Dependent job' option.

       The screen appears as:

**********************************************************************
*                                                                    *
*                             Work Dependent Job - TAA           ... *
*                                                                    *
*   Position to dependent job . . . __________           Master  ... *
*                                                                    *
*   Type options, press Enter.                                       *
*     5=Display                                                      *
*                                                                    *
*   Opt  Dep job      Status       Text or Command                   *
*    _   ORDERS1      *PASS        CALL PGM(TAAJODFC30)              *
*    _   ORDERS2      *WAITDEP     CALL PGM(TAAJODFC30)              *
*                                                                    *
*   F3=Exit    F12=Cancel                                            *
**********************************************************************


  **   ORDERS1 has  completed (status = *PASS).   ORDERS2 has  a status
       of  *WAITDEP meaning the  Master Job  has been started,  but the
       job is waiting for a dependency to be met.

  **   Use F3 until you return to a command line.

  **   Set Switch 1 for ORDERS by entering:

             SETJOBDEP   MSTJOB(ORDERS) SWITCH(*SW1)

       When SETJOBDEP is  run, the  JOBDEP tool  checks to  see if  any
       Dependent Jobs should  be submitted for  the Master Job.   Since
       the switch  is now set  *ON, ORDERS2 would be  submitted and you
       should see that ORDERS2 completed normally.

PAYABLES Dependent Job which uses an Object Existence Test
----------------------------------------------------------

  **   The  next test job  is PAYABLES which  uses an 'object existence
       test' to determine if a Dependent Job should start.  Enter:

             WRKJOBDEPD

       Use the '2 =  Change' option to see the definition  of PAYABLES.

  **   Rollup  twice to  see  the display  that  defines which  objects
       will be 'tested for existence'.

       The screen appears as:

**********************************************************************
*                                                                    *
*         Work Dependent Jobs Dsc TAA  - Change Object Existence ... *
*                                                                    *
*   Master name:   PAYABLES     The PAYABLES test - Object Exist ... *
*                                                                    *
*   Enter an object/library and type to check an object for exis ... *
*                                                                    *
*           Object    Library    Type     Text                       *
*                                                                    *
*   *OBJ1  DTAARA1___ TSTJOBDEP_ *DTAARA  ** Object does not exi ... *
*   *OBJ2  __________ __________ _______                             *
*    ..                                                              *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

       You  can  define 5  objects  to be  tested for  existence.   For
       PAYABLES, a  data area by  the name  of DTAARA1  is defined  for
       library TSTJOBDEP.   As  with the switches,  you must  define an
       object to  be tested before describing the  object as a Function
       for a Dependent Job.

       Note the text description of  DTAARA1 describes that the  object
       does not exist  at this time.   This would be normal  before the
       job  starts.   At some  time  while the  job is  in  process, an
       application function will create the object.

  **   Return  to the  main display  and use  the '9 =  Dependent jobs'
       option.

  **   Use the '2  = Change' option  for both Dependent Jobs  PAYABLES1
       and PAYABLES2.

  **   The  PAYABLES1 display  shows the  standard test  program  to be
       submitted.

       The screen appears as:

**********************************************************************
*                                                                    *
*      Work Job Dependent Description - Dependent Jobs - TAA     ... *
*                                                                    *
*   Master job  . . . . . . :   PAYABLES                             *
*   Dependent job . . . . . :   PAYABLES1_               Name        *
*   Command to submit . . . :   CALL PGM(TAAJODFC30)_______________  *
*  ________________________________________________                  *
*   Text  . . . . . . . . . :   ___________________________________  *
*   Job description . . . . :   *MASTER___               Name        *
*     Library . . . . . . . :     __________             Name        *
*   Job queue . . . . . . . :   *MASTER___               Name        *
*     Library . . . . . . . :     __________             Name        *
*   End Master at completion:   *NO_                     *YES, *NO   *
*                                                                    *
*             Rollup for dependencies.                               *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit     F5=Refresh     F12=Cancel                            *
**********************************************************************

  **   Rollup  for   dependencies  and  you  can  see  there  are  none
       defined.    PAYABLES1  will  start  when  STRJOBDEP  starts  the
       Master Job PAYABLES.

  **   Press Enter to  see the display for PAYABLES2.   It also submits
       the  standard test  program, but  if you Rollup  you will  see a
       dependency is defined that *OBJ1 must *EXIST.

       The screen appears as:

**********************************************************************
*                                                                    *
*        Work Job Dependent Description - Dependent Jobs - TAA   ... *
*                                                                    *
*   Master job  . :  PAYABLES    The PAYABLES test - Object Exis ... *
*                                                                    *
*   Dependent job :  PAYABLES2                                       *
*                                                                    *
*   Cmd to submit :  CALL PGM(TAAJODFC30)                            *
*                                                                    *
*   And/Or   Function    Condition    Text description               *
*                                                                    *
*            *OBJ1_____  *EXIST____   If DTAARA1 in TSTJOBDEP exists *
*   *AND     __________  __________   ______________________________ *
*    ..                                                              *
*                                                                    *
*   Press Enter to change record and continue.                       *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

       *OBJ1 refers to the entry made  for the Master Job as the  first
       object defined.  PAYABLES2 will not start until:

           - DTAARA1 in TSTJOBDEP is created
           - Some event causes the JOBDEP tool to check for submission

       Note that  creating the object  will not  cause PAYABLES2 to  be
       submitted.   It takes some other action  (described later) after
       the  object has been  created to cause the  JOBDEP tool to check
       for submission.

  **   Use F3 until you return to command line.

  **   Start the PAYABLES job by entering:

             STRJOBDEP   MSTJOB(PAYABLES)

  **   You  should  see PAYABLES1  complete,  but  PAYABLES2  will  not
       start because the data area DTAARA1 does not exist.

  **   Use WRKJOBDEP to review the status of the job:

             WRKJOBDEP   MSTJOB(PAYABLES)

       You should  see the  status as *PROCESS  meaning the  Master Job
       has not been completed.

  **   Use  the '5 = Display' option  to see the Master Job.   It has a
       start date, but not an end date.

  **   Return to  the main display  and use  the '9  = Dependent  jobs'
       option.

       The screen appears as:

**********************************************************************
*                                                                    *
*                             Work Job Dependent - TAA           ... *
*                                                                    *
*   Position to dependent job . . .  __________          Master  ... *
*                                                                    *
*   Type options, press Enter.                                       *
*     5=Display                                                      *
*                                                                    *
*   Opt  Dep job      Status       Text or Command                   *
*    _   PAYABLES1    *PASS        CALL PGM(TAAJODFC30)              *
*    _   PAYABLES2    *WAITDEP     CALL PGM(TAAJODFC30)              *
*                                                                    *
*   F3=Exit    F5=Refresh    F12=Cancel                              *
**********************************************************************

       PAYABLES1 has completed  successfully (*PASS).  PAYABLES2  has a
       status  of *WAITDEP meaning  it is  waiting for a  dependency to
       be satisfied.

  **   Use the '5 = Display' option for PAYABLES2.

       The screen appears as:

**********************************************************************
*                                                                    *
*                 Work Job Dependent - TAA - Dependent Job Recor ... *
*                                                                    *
*   Master job  . . . . . . :   PAYABLES                             *
*   Dependent job . . . . . :   PAYABLES2                            *
*   Command to submit . . . :   CALL PGM(TAAJODFC30)                 *
*                                                                    *
*   Text descrp of job  . . :                                        *
*   Job description . . . . :   *MASTER                              *
*   Job queue . . . . . . . :   *MASTER                              *
*   Qualified job name  . . :                                        *
*   End master if completed :   *NO                                  *
*   Master job start date . :   12/11/09  at    8:55:46              *
*   Submit date . . . . . . :                                        *
*   Start date  . . . . . . :                                        *
*   End date  . . . . . . . :                                        *
*   Completion code . . . . :   ** Not completed **                  *
*   Number of dependencies  :   1                                    *
*   Change def user . . . . :   SLOAN                                *
*   Change def date . . . . :   12/09/05  at   1:44:810              *
*             Rollup for dependencies.                               *
*                                                                    *
*   F3=Exit     F12=Cancel     Press Enter to continue.              *
**********************************************************************

       The screen appears as:

  **   The job has not been submitted (no submit date or time).

  **   Use F3 until you return to a command line.

  **   Create the data area (including a text description).

             CRTDTAARA   DTAARA(TSTJOBDEP/DTAARA1) TYPE(*CHAR) LEN(1)
                           TEXT('Data area for PAYABLES test')

  **   PAYABLES2 still does  not start  because no  event has  occurred
       that will cause  the JOBDEP tool  to check for submission.   The
       events that cause checking for submission are:

             - The completion of a Dependent Job
             - The SETJOBDEP command (discussed previously)
             - The CHKJOBDEP command

  **   Use WRKJOBDEP (not WRKJOBDEPD):

             WRKJOBDEP

       You should see that PAYABLES still has a status of *PROCESS.

  **   Use the  '5 = Display' option, and the  Rollup twice, the screen
       appears as:

**********************************************************************
*                                                                    *
*              Work Job Dependent TAA - Objects for Existence Te ... *
*                                                                    *
*   Master name:   PAYABLES     The PAYABLES test - Object Exist ... *
*                                                                    *
*   Object 1  . . . . . . . :   DTAARA1     Library:  TSTJOBDEP  ... *
*      Exists                   Data area for PAYABLES test          *
*                                                                    *
*   F3=Exit     F12=Cancel     Press Enter to continue.              *
**********************************************************************

       Note that DTAARA1 exists and the text description is shown.

  **   Press Enter to the main display.

  **   For PAYABLES, use the '9 = Dependent Jobs' option,

       The screen appears as:

**********************************************************************
*                                                                    *
*                             Work Job Dependent - TAA           ... *
*                                                                    *
*   Position to dependent job . . .  __________          Master  ... *
*                                                                    *
*   Type options, press Enter.                                       *
*     5=Display                                                      *
*                                                                    *
*   Opt  Dep job      Status       Text or Command                   *
*    _   PAYABLES1    *PASS        CALL PGM(TAAJODFC30)              *
*    _   PAYABLES2    *WAITDEP     CALL PGM(TAAJODFC30)              *
*                                                                    *
*   F3=Exit    F12=Cancel                                            *
**********************************************************************

  **   PAYABLES2  has a  status of  *WAITDEP.   Although the  data area
       exists, no  function  has occurred  to  cause the  checking  for
       submission.

  **   Use F3 until you return to a command line.

  **   The CHKJOBDEP command causes checking for submission.  Enter:

             CHKJOBDEP     MSTJOB(PAYABLES)

  **   You should now see PAYABLES2 complete normally.

  **   CHKJOBDEP is also an option on the WRKJOBDEP main display.


Printing
--------

  **   Three print commands are provided:

         --   PRTJOBDEPD   -   Prints    the   Master   and   Dependent
              descriptions

         --   PRTJOBDEP  - Prints  the status information  of Dependent
              Jobs

         --   PRTJOBDEPH - Prints the status information from history

  **   The commands may  be entered  on a  command line or  used as  an
       option from WRKJOBDEPD, WRKJOBDEP, or DSPJOBDEPH.

  **   Enter the WRKJOBDEPD command:

           WRKJOBDEPD

  **   Use the '8 = Print' option for PAYABLES2.

  **   Use F3 to return to a command line.

  **   Use WRKSPLF and option 5 to display the spooled file.

Retrieving information in CL programs
-------------------------------------

  **   Two RTV  commands are  provided to  allow CL  program access  to
       the stored information.

         --   RTVJOBDEPD - Retrieves Master description and status

         --   RTVJOBDEP  -  Retrieves  Dependent  Job  description  and
              status

  **   Prompt for each command and review the return fields.

Menu of Commands
----------------

  **   The JOBDEP  tool has  several commands.   Most  of the  commands
       were used  during the  demonstration.   The commands are  broken
       down into the following groups:

         --   Commands that operate on Job Dependent Descriptions

         --   Commands that  Start, End, Work,  etc on a  Job Dependent
              structure

         --   Commands that operate on Job Dependent History

  **   To see an overview of the commands, a menu is provided:

            GO  JOBDEP

       You can run most of the commands from the menu.

Making your changes to the Demonstration
----------------------------------------

You  can make  any change  to the demonstration  data.   To refresh the
data, clear the test library and start again.

Cleaning up the Demonstration
-----------------------------

  **   If you are finished with the test demonstration:

            RMVLIBLE      LIB(TSTJOBDEP)
            DLTLIB        LIB(TSTJOBDEP)
					

Added to TAA Productivity tools January 15, 2002


Home Page Up to Top