TAA Tools
JOBINF          JOB INFORMATION                        TAAJOFG

The Job Information tool  provides commands that allow you  to create a
record when  a job begins and  ends.  The information  that is captured
includes  how and  when the  job started  and a summary  of performance
information when the job  ended.  The STRJOBINF and  ENDJOBINF commands
must be included in the job.

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

  **   You begin by creating files in QGPL.

             CRTJOBINF

       This creates  the JOBINFP physical and JOBINFL  logical in QGPL.

  **   You  must include  the STRJOBINF  and ENDJOBINF commands  in the
       job you  want to capture  the information  for.   A simple  test
       program  TAAJOFGC20  exists  that  you may  try.    It  has  the
       following code:

             PGM
             STRJOBINF
             CHKOBJ    OBJ(TAATOOL) OBJTYPE(*LIB)
             ENDJOBINF
             ENDPGM

       Submit a job for the program as:

             SBMJOB    JOB(TSTJOBINF) PGM(CALL TAAJOFGC20)
                          JOBQ(QSYSNOMAX)

       The  STRJOBINF command  captures information  about how  the job
       started including  such information  as the  job queue  and  the
       job type.   A record is written to  the JOBINFP file with  a key
       of Job, User, and Job Number.

       The  ENDJOBINF command  captures  performance  information about
       the  job  including Disk  I/Os, CPU  time, transactions/response
       time/average response time  (if interactive), page  faults, etc.
       It updates the record for the same key in JOBINFP.

  **   The Job Information can then be displayed:

             DSPJOBINF

       Use  Option  5  to  display  the details  and  rollup  for  more
       information.

  **   To use the commands in an interactive job enter:

             STRJOBINF

       Then enter a command to cause some interaction such as:

             DSPTAACAT  *JOB

       Use F3 and then

             ENDJOBINF

  **   Display the information with

             DSPJOBINF

       You  should see the job  you submitted and the  results from the
       interactive job.   Because  only a  single  command was  entered
       and a  minimal of keystrokes,  the performance  information will
       be  minimal.    Using the  commands  during  a normal  operation
       would produce more normal results.

  **   To print  the information,  the PRTJOBINF  command supports  the
       OPTION parameter to allow  different listing types.  To  see the
       basic information, enter

            PRTJOBINF

       You can try the other values for the OPTION parameter.

  **   If  you are  not interested in  using the  JOBINF tool,  you can
       delete the files with:

             DLTJOBINF

Commands provided
-----------------

     CRTJOBINF   - Creates the JOBINFP and JOBINFL files in QGPL
     DLTJOBINF   - Deletes the JOBINFP and JOBINFL files in QGPL
     STRJOBINF   - Captures the job start information
     ENDJOBINF   - Captures the job performance information
     DSPJOBINF   - Display the job information
     MTNJOBINF   - Maintains the JOBINFP file by retention date
     PRTJOBINF   - Print the job information with options

Command usage
-------------

  **   STRJOBINF  causes  a reset  of  the job  performance information
       which instructs  the system to  capture performance  information
       about the job.   Since the command must be run  after the job is
       started,  the   overhead  to  start  the  job  and  the  program
       containing STRJOBINF will not be included.

  **   ENDJOBINF  retrieves  performance  information  when  it   runs.
       Since  the command  must be  run before  the job  ends, the  job
       ending  functions such as the  cleanup of QTEMP,  the writing of
       the job log, etc will not be included.

  **   If the job fails  or ends before the  ENDJOBINF command is  run,
       no performance information will exist.

  **   If  an  ENDJOBINF  command is  issued  without  a  corresponding
       STRJOBINF command  for the same job, the  start date/time of the
       job  is assumed  to be the  date/time of  the ENDJOBINF command.
       This allows  the MTNJOBINF command  to purge  the records.   The
       job performance  information will be updated in  the job record,
       but no information about the starting of the job will exist.

  **   If  more than  one ENDJOBINF  command is run  for the  same job,
       the  previous  performance  information  is  lost  and  the  new
       performance information is updated in the job record.

  **   It is possible  to reset the performance  information during the
       running  of  job  so  the  performance  information captured  by
       ENDJOBINF will  only represent  the  information from  the  last
       reset.  Resetting  the job performance information can  occur by
       use  of  RESJOBPERF, RTVJOBPERF  RESET(*YES)  or  a QUSRJOB  API
       option.

  **   If  more than one STRJOBINF command  is issued for the same job,
       an  escape message  will  occur.    The escape  message  can  be
       avoided by specifying DUPERR(*NO) on STRJOBINF.

       This could  be useful  if a program  using STRJOBINF  could both
       be  called as  a sub  program and submitted  as a  separate job.
       If a  main job  calling this  program also  used STRJOBINF,  the
       escape  message  would  occur  during the  running  of  the  sub
       program  unless DUPERR(*NO) is specified.   The information from
       the first use of STRJOBINF would still exist.

Maintaining JOBINFP
-------------------

The JOBINFP file  should be periodically  purged of old  records.   The
MTNJOBINF command  allows  a retention  date (default  of  30 days)  to
cleanup the  file.  MTNJOBINF  also supports parameters  for JOB, USER,
and  JOBTYP so  it is  possible to use  the command  multiple times and
vary the retention date depending on the job, user, or job type.

When MTNJOBINF runs, it  places an *EXCL lock  on the file in  QGPL and
then copies  the JOBINFP file in  QGPL to the JOBINFP  file in TAAWORK.
The  JOBINFP file in  QGPL is then  cleared and the  records are copied
back if  they  meet  the retention  criteria.   At  the  completion  of
MTNJOBINF,  the version  in  TAAWORK is  deleted and  the  lock on  the
version in QGPL is removed.

Because  MTNJOBINF will lock the  file, the command should  be run when
no other jobs will use STR/ENDJOBINF.

If the command  or system fails  during the running  of MTNJOBINF,  the
original information is still  retained in the TAAWORK library  and may
be used to refresh the JOBINFP file with a simple copy.

If  the JOBINFP  file exists  in TAAWORK  when  MTNJOBINF is  used, the
command  ends  with  an  escape  message as  the  previous  use  of the
command did not  end normally.   If a complex  recovery is needed,  the
use  of CPYF  with selection  on the  the JOSTRD  field (start  date in
CYMD format) in JOBINFP could be used.

CRTJOBINF escape messages you can monitor for
---------------------------------------------

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

DLTJOBINF escape messages you can monitor for
---------------------------------------------

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

STRJOBINF escape messages you can monitor for
---------------------------------------------

      TAA9894    A prior STR command was used and DUPERR(*YES)

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

ENDJOBINF escape messages you can monitor for
---------------------------------------------

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

DSPJOBINF escape messages you can monitor for
---------------------------------------------

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

MTNJOBINF escape messages you can monitor for
---------------------------------------------

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

PRTJOBINF escape messages you can monitor for
---------------------------------------------

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

CRTJOBINF Command parameters                          *CMD
----------------------------

   SRCLIB        The  source library  of  the DDS  source.   *TAAARC is
                 the  default  to  access  the  source  from   the  TAA
                 Archive.  A  specific library may also be  used if you
                 have  first  copied  the source  from  the  Archive to
                 your library.   The source file  name QATTDDS must  be
                 used.


DLTJOBINF Command parameters                          *CMD
----------------------------

No parameters exist.


STRJOBINF Command parameters                          *CMD
----------------------------

   DUPERR        A  *YES/*NO parameter  that  determines if  an  escape
                 message  will be sent  if the  current Job/User/JobNbr
                 matches  a key in  the JOBINFP file.   For example, if
                 the same job issued two STRJOBINF commands.

                 *YES is  the default which  causes the escape  message
                 TAA9894 if the key already exists.

                 *NO  may be  specified  to bypass  the  sending of  an
                 escape  message.   This could  be useful if  a program
                 using  STRJOBINF  could  both  be  called  as   a  sub
                 program and  submitted as a separate  job.  If  a main
                 job  calling  this program  also  used  STRJOBINF, the
                 escape message would occur  during the running of  the
                 sub  program unless  DUPERR(*NO)  is specified.    The
                 information  from  the first  use  of STRJOBINF  would
                 still exist.


ENDJOBINF Command parameters                          *CMD
----------------------------

No parameters exist


DSPJOBINF Command parameters                          *CMD
----------------------------

   JOB           The  name or generic name of  the job to be displayed.

                 *ALL is the  default which  means no selection  occurs
                 on the job name.

   USER          The  name   or  generic  name   of  the  user   to  be
                 displayed.

                 *ALL  is the default  which means  no selection occurs
                 on the user name.

   JOBTYP        The job type to be displayed.

                 *ALL is the  default which  means no selection  occurs
                 on  the job  type.   Either  I=Interactive or  B=Batch
                 may  be entered  to select  only  the jobs  that match
                 the specified type.


MTNJOBINF Command parameters                          *CMD
----------------------------

   RTNDAYS       The number  of  days  to retain  the  job  information
                 records for.    The default  is 30  days.   The  start
                 date  is  used   for  comparison.    If  an  ENDJOBINF
                 command   was   issued  without   a   prior  STRJOBINF
                 command, the start date  is assumed to be the  date of
                 ENDJOBINF.

                 If  the current date  is 01/01/11  and the  default is
                 used,  any job  records with  a start  date of  Dec 2,
                 2010 or  later  would  be  retained.   The  other  job
                 records  would be  considered  for  deletion based  on
                 the other parameters.

   RTNDAYS       The  name or  generic  name of  the job  record  to be
                 deleted.

                 *ALL is the  default which means  no selection  occurs
                 on the job name.

   USER          The name  or generic name  of the  user job record  to
                 be deleted.

                 *ALL  is the default  which means no  selection occurs
                 on the user name.

   JOBTYP        The job type to be deleted.

                 *ALL  is the  default which means  no selection occurs
                 on  the  job   type  of  the   job  record.     Either
                 I=Interactive  or B=Batch  may  be  entered to  select
                 only the jobs that match the specified type.


PRTJOBINF Command parameters                          *CMD
----------------------------

   JOB           The name or generic name of the job to be listed.

                 *ALL  is the default  which means  no selection occurs
                 on the job name.

   USER          The name or generic name of the user to be listed.

                 *ALL is the  default which  means no selection  occurs
                 on the user name.

   JOBTYP        The job type to be listed.

                 *ALL is  the default  which means no  selection occurs
                 on  the  job type.   Either  I=Interactive  or B=Batch
                 may be  entered to  select only  the jobs  that  match
                 the specified type.

   OPTION        The type of listing to be output.

                 *BASIC is the  default to list  the job start  and end
                 times, CPU  usage, transactions, and  average response
                 time.

                 *SBM  lists the  information about how  and when batch
                 jobs were submitted.

                 *SCD lists  the  information about  when  the job  was
                 scheduled if it was scheduled.

                 *CPU lists information about CPU usage.

                 *DISK lists information about disk usage.

   OUTPUT        How  to output  the  results.   *  is  the default  to
                 display  the spooled  file if  the command  is entered
                 interactively.  The spooled  file is deleted after  it
                 is displayed.

                 If  the  command is  entered  in  batch or  *PRINT  is
                 specified,  the spooled  file is output  and retained.


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

See the section on 'Command usage'.

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

The following TAA Tools must be on your system:

     ADDDAT          Add date
     ADJVAR          Adjust variable
     CHKGENERC       Check generic
     CPYTAADDS       Copy TAA data description source
     CVTDAT          Convert date
     EDTVAR          Edit variable
     HLRMVMSG        HLL Remove message
     FILEFDBCK       File feedback
     RSNLSTMSG       Resend last message
     RTVJOBPERF      Retrieve job performance
     RTVJOBSTRA      Retrieve job start attributes
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     UPDPFILE        Update the PFILE keyword

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

None, the tool is ready to use.

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

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

   CRTJOBINF     *CMD                   TAAJOFG       QATTCMD
   DLTJOBINF     *CMD                   TAAJOFG2      QATTCMD
   STRJOBINF     *CMD                   TAAJOFG3      QATTCMD
   ENDJOBINF     *CMD                   TAAJOFG4      QATTCMD
   DSPJOBINF     *CMD                   TAAJOFG5      QATTCMD
   MTNJOBINF     *CMD                   TAAJOFG6      QATTCMD
   PRTJOBINF     *CMD                   TAAJOFG7      QATTCMD
   TAAJOFGC      *PGM       CLP         TAAJOFGC      QATTCL
   TAAJOFGC2     *PGM       CLP         TAAJOFGC2     QATTCL
   TAAJOFGC3     *PGM       CLP         TAAJOFGC3     QATTCL
   TAAJOFGC4     *PGM       CLP         TAAJOFGC4     QATTCL
   TAAJOFGC5     *PGM       CLP         TAAJOFGC5     QATTCL
   TAAJOFGC6     *PGM       CLP         TAAJOFGC6     QATTCL
   TAAJOFGC7     *PGM       CLP         TAAJOFGC7     QATTCL
   TAAJOFGC20    *PGM       CLP         TAAJOFGC20    QATTCL
   TAAJOFGR3     *PGM       RPG         TAAJOFGR3     QATTRPG
   TAAJOFGR4     *PGM       RPG         TAAJOFGR4     QATTRPG
   TAAJOFGR5     *PGM       RPG         TAAJOFGR5     QATTRPG
   TAAJOFGR6     *PGM       RPG         TAAJOFGR6     QATTRPG
   TAAJOFGR7     *PGM       RPG         TAAJOFGR7     QATTRPG
   TAAJOFGD      *FILE      DSPF        TAAJOFGD      QATTDDS
   TAAJOFGP      *FILE      PF          TAAJOFGP      QATTDDS
   TAAJOFGQ      *FILE      PF

TAAJOFGQ is duplicated from TAAJOFGP.

Structure
---------

CRTJOBINF   Cmd
   TAAJOFGC   CL pgm

DLTJOBINF   Cmd
   TAAJOFGC2  CL pgm

STRJOBINF   Cmd
   TAAJOFGC3  CL pgm
     TAAJOFGR3   RPG Pgm

ENDJOBINF   Cmd
   TAAJOFGC4  CL pgm
     TAAJOFGR4   RPG Pgm

DSPJOBINF   Cmd
   TAAJOFGC5  CL pgm
     TAAJOFGR5   RPG Pgm
       TAAJOFGD    Display file

MTNJOBINF   Cmd
   TAAJOFGC6   CL pgm
     TAAJOFGR6   RPG Pgm

PRTJOBINF   Cmd
   TAAJOFGC7   CL pgm
     TAAJOFGR7   RPG Pgm
					

Added to TAA Productivity tools April 15, 2010


Home Page Up to Top