TAA Tools
JOBACT          JOB ACTIVE                             TAAJOEC

The Job Active  tool provides a  periodic check for critical  jobs that
are designed  to be active at all  times.  If one of  these jobs is not
active,  a message may be  sent to QSYSMSG (QSYSOPR  is used if QSYSMSG
does not exist) or a command may be run.

A related function  is the TAA RTVJOBSTS  command which will allow  you
to check for the status of a job in a CL program.

Several commands exist:

        CRTJOBACT     Creates the file to hold the critical jobs
        DLTJOBACT     Deletes the file holding the critical jobs
        WRKJOBACT     Maintains the file of critical jobs
        STRJOBACT     Starts the TAAJOBACT batch job
        ENDJOBACT     Ends the TAAJOBACT job
        STRJOBACT2    Adds auto start job entry for STRJOBACT command

Getting started
---------------

  **   As an  *ALLOBJ special authority  user, use CRTJOBACT  to create
       the files required by the tool in a specific library:

          CRTJOBACT    LIB(xxx)

       The  default authority  assigned is  *USE, which will  allow any
       user to display or use the  STRJOBACT command.  You may want  to
       authorize  certain  users to  be  able  to  update the  file  by
       giving them *CHANGE authority.

  **   Use WRKJOBACT to enter the critical jobs:

          WRKJOBACT    LIB(xxx)

       Use  F6 to enter  a critical  job.  The  job must have  a unique
       name on  your system.    A text  description may  be  optionally
       entered.  An action must be entered.

       The default action  is *MSG.  If the  job is not active  and the
       QSYSMSG  message  queue  exists  in  QSYS,  a  message  is  sent
       describing  the  condition.    If  QSYSMSG  does  not  exist,  a
       message is sent to QSYSOPR.

       A command may  be entered as  the action to  be performed.   For
       example, you may  want to restart some function.   See the later
       discussion on 'Actions'.

  **   Start the TAAJOBACT job with the command:

          STRJOBACT    WAIT(60) LIB(xxx)

The  TAAJOBACT job would be submitted to  batch using the QSYSNOMAX job
queue.  By default,  no checking would occur for  60 seconds.  The  job
would wake  up every  60 seconds and  check if  the jobs  you specified
were still active.

The  TAAJOBACT  job  in  batch  uses  the  TAAJOECC14 program.    While
TAAJOBACT is running, you may make  changes to the critical jobs  using
WRKJOBACT.  This includes adding, changing, or deleting entries.

There are 2  methods of entering  the STRJOBACT command to  ensure that
it  is running when  the system  begins.   See the later  discussion of
the 'System Startup program' and 'Auto start job'.

Actions
-------

The  default action is *MSG which will send  a message to QSYSMSG if it
exists and if not to QSYSOPR.

You may enter a  command such as SHOUT to  send a break message to  one
or more users.

You may enter  a command to restart  a function.  The command  may be a
CALL to a program.

CRTJOBACT escape messages you can monitor for
---------------------------------------------

None.  Escape messages from based on functions will be re-sent.

DLTJOBACT escape messages you can monitor for
---------------------------------------------

None.  Escape messages from based on functions will be re-sent.

WRKJOBACT escape messages you can monitor for
---------------------------------------------

None.  Escape messages from based on functions will be re-sent.

STRJOBACT escape messages you can monitor for
---------------------------------------------

      TAA9892    The TAAJOBACT job is already active.

Escape messages from based on functions will be re-sent.

ENDJOBACT escape messages you can monitor for
---------------------------------------------

      TAA9891    More than one TAAJOBACT job is active.

Escape messages from based on functions will be re-sent.

STRJOBACT2 escape messages you can monitor for
----------------------------------------------

None.  Escape messages from based on functions will be re-sent.

The system startup program
--------------------------

If  you are using the system default  startup program, the system value
QSTRUPPGM will specify  QSTRUP in  QSYS.  The  simplest solution  would
be to  tailor this  program to include  your unique  startup functions.
Use  RTVCLSRC  to  retrieve  the  source.   Add  the  TAATOOL/STRJOBACT
command with  your  required  parameters  before  the  RETURN  command.
Then create  your own version  of the program  in a library  and change
the  QSTRUPPGM  system value  to  refer to  your  program and  library.
Note that you should not replace the QSTRUP program in QSYS.

If  you already  have a  unique startup  program, add TAATOOL/STRJOBACT
(with your  required parameters)  at  a location  where it  is sure  to
run.

If  you  end  all  subsystems   to  reach  the  restricted  state,  the
TAAJOBACT  job   will  be  ended.    When  you  start  the  controlling
subsystem, the startup program will automatically run.

Note that  the  system supplied  startup  program  may change  on  each
release.  A good  tool to compare your version  with the shipped system
version is the TAA Tool CMPSTRUP.

Auto start job
--------------

An  alternative to using the  startup program is to  use the STRJOBACT2
command to add  an autostart  job entry to  the controlling  subsystem.
The JOBACT Job  Description is shipped  in TAATOOL with a  base command
as:

         STRJOBACT     WAIT(60) JOBACTLIB(QGPL) DLYJOB(60)

If  your  requirements  differ, you  must  use  CHGJOBD  to modify  the
command.    Note that  the JOBACTLIB  is QGPL  which  you will  need to
change if you created the JOBACT files in a different library.

The JOBACT  Job  Description  is shipped  as  *PUBLIC *EXCLUDE.    When
STRJOBACT2 runs, it  authorizes QPGMR to use the  Job Description which
is required for an auto start job.

CRTJOBACT Command parameters                          *CMD
----------------------------

   JOBACTLIB     The  library  to  contain the  Job  Active  files.   A
                 physical file (JOBACTP) and  a logical file  (JOBACTL)
                 will be created.

   SRCLIB        The  source  library  to  use  for  the  QATTDDS  file
                 source.  The default is *TAAARC.

                 A specific  user library may be  named, but the source
                 file name must be QATTDDS.

   AUT           The authority to the DTAARCP physical file.

                 *USE is the default.

                 *CHANGE or *EXCLUDE may be specified.

DLTJOBACT Command parameters                          *CMD
----------------------------

   JOBACTLIB     The library that contains the Job Active files.

                 The default is *LIBL.   A specific library or  *CURLIB
                 may also be entered.

WRKJOBACT Command parameters                          *CMD
----------------------------

   JOBACTLIB     The library that contains the Job Active files.

                 The default is  *LIBL.  A specific library  or *CURLIB
                 may also be entered.

STRJOBACT Command parameters                          *CMD
----------------------------

   WAIT          The  wait  time  interval  for checking  the  critical
                 jobs.    The  default is  60  seconds.   When  the job
                 starts it  delays  for the  amount  of time  specified
                 for  the DLYJOB parameter.   It  then checks  the jobs
                 described  in the JOBACTP file and  waits for the WAIT
                 time interval before checking again.

   DLYJOB        The amount of time to  wait before the first check  is
                 made for  critical jobs.   The  default is 60  meaning
                 the jobs  will not be checked until  the batch job has
                 been active for 60 seconds.

                 A value  up to  99999  seconds may  be entered.    The
                 purpose of  a  delay time  is to  allow the  STRJOBACT
                 function   to  be  included   with  the   starting  of
                 critical  jobs.   If both critical  jobs and STRJOBACT
                 are started at the  same time, a critical job  may not
                 have  started  when  the   TAAJOBACT  job  begins  the
                 checking  process.   The  DLYJOB parameter  allows the
                 TAAJOBACT job to wait for  a number of seconds  before
                 first checking that the critical jobs are active.

   JOBACTLIB     The library that contains the Job Active files.

                 The default is  *LIBL.  A specific  library or *CURLIB
                 may also be entered.

ENDJOBACT Command parameters                          *CMD
----------------------------

No parameters exist.

STRJOBACT2 Command parameters                         *CMD
-----------------------------

   WAIT          The  wait  time  interval  for  checking the  critical
                 jobs.   The  default is  60  seconds.   When  the  job
                 starts  it delays  for the  amount  of time  specified
                 for  the DLYJOB parameter.   It  then checks  the jobs
                 described  in the JOBACTP file  and waits for the WAIT
                 time interval before checking again.

   DLYJOB        The amount of time  to wait before the first  check is
                 made  for critical jobs.   The  default is  60 meaning
                 the  jobs will not be checked  until the batch job has
                 been active for 60 seconds.

                 A value  up to  99999  seconds may  be entered.    The
                 purpose  of a  delay time  is to  allow the  STRJOBACT
                 function   to  be   included  with  the   starting  of
                 critical jobs.   If both critical  jobs and  STRJOBACT
                 are started at the  same time, a critical job  may not
                 have  started  when   the  TAAJOBACT  job  begins  the
                 checking  process.   The  DLYJOB parameter  allows the
                 TAAJOBACT job to wait  for a number of seconds  before
                 first checking that the critical jobs are active.

   JOBACTLIB     The library that contains the Job Active files.

                 The default  is *LIBL.  A specific  library or *CURLIB
                 may also be entered.

Restrictions
------------

Only  a user with  *ALLOBJ special  authority can use  the CRTJOBACT or
DLTJOBACT commands.

Prerequisites
-------------

The following TAA Tools must be on your system:

     CHKACTOBJ       Check active object
     CHKALLOBJ       Check *ALLOBJ special authority
     CHKNAM          Check name
     OPNDBR          Open Data Base records
     CPYTAADDS       Copy TAA DDS
     EDTVAR          Edit variable
     RSNLSTMSG       Resend last message
     RTVDIAGMSG      Retrieve diagnostic message
     RTVIPLSTS       Retrieve IPL status
     RTVJOBSTS       Retrieve job status
     SNDCOMPMSG      Send completion message
     SNDDIAGMSG      Send diagnostic message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     UPDPFILE        Update PFILE

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   CRTJOBACT     *CMD                   TAAJOEC       QATTCMD
   DLTJOBACT     *CMD                   TAAJOEC2      QATTCMD
   WRKJOBACT     *CMD                   TAAJOEC3      QATTCMD
   STRJOBACT     *CMD                   TAAJOEC4      QATTCMD
   ENDJOBACT     *CMD                   TAAJOEC5      QATTCMD
   STRJOBACT2    *CMD                   TAAJOEC6      QATTCMD
   TAAJOECC      *PGM       CLP         TAAJOECC      QATTCL
   TAAJOECC2     *PGM       CLP         TAAJOECC2     QATTCL
   TAAJOECC3     *PGM       CLP         TAAJOECC3     QATTCL
   TAAJOECC4     *PGM       CLP         TAAJOECC4     QATTCL
   TAAJOECC5     *PGM       CLP         TAAJOECC5     QATTCL
   TAAJOECC6     *PGM       CLP         TAAJOECC6     QATTCL
   TAAJOECC13    *PGM       CLP         TAAJOECC13    QATTCL
   TAAJOECC14    *PGM       CLP         TAAJOECC14    QATTCL
   TAAJOECC15    *PGM       CLP         TAAJOECC15    QATTCL
   TAAJOECR3     *PGM       RPG         TAAJOECR3     QATTRPG
   TAAJOECD      *FILE      DSPF        TAAJOECD      QATTDDS
   TAAJOECP      *FILE      PF          TAAJOECP      QATTDDS
   TAAJOECL      *FILE      LF          TAAJOECL      QATTDDS

Structure
---------

CRTJOBACT   Cmd
   TAAJOECC   CL pgm

DLTJOBACT   Cmd
   TAAJOECC2   CL pgm

WRKJOBACT   Cmd
   TAAJOECC3   CL pgm
     TAAJOECR3   RPG pgm
       TAAJOECC13  CL pgm - Check JOB name
       TAAJOECC15  CL pgm - Prompt for command
       TAAJOECD    DSP file

STRJOBACT   Cmd
   TAAJOECC4   CL pgm  - Submits TAAJOBACT job (TAAJOECC14)
     TAAJOECC14   CL pgm - Batch job

ENDJOBACT   Cmd
   TAAJOECC5   CL pgm

STRJOBACT2  Cmd
   TAAJOECC6   CL pgm
					

Added to TAA Productivity tools April 15, 2006


Home Page Up to Top