TAA Tools
JLGCTL          JOB LOG CONTROL                        TAALOGB

The Job Log Control tool is a series of commands that lets you:

  **   Convert job log spooled files to a set of data base files.

  **   Easily find the  job log you  are looking for by  using multiple
       logical files such as by Job, by Date, or by User.

  **   Display the  data in subfiles  by job names  and messages within
       a job log.

  **   Re-print  a job  log.   Various options  exist to 'net  out' the
       job log to reduce the amount of information that is printed.

  **   Maintain the data base files to remove old job logs.

The advantages of Job Log Control are:

  **   You can remove the  job log spooled files after  the information
       is  placed in  the  data base  files.   This  helps cleanup  the
       system  because  the  job  log  may  be  the  last spooled  file
       associated with  a job.   If the  last spooled  file is  removed
       when  the job  is  no longer  active,  the system  automatically
       removes the job structure associated with the job.

  **   Reviewing the  job log information from  subfile displays can be
       a lot more  convenient than  paging thru a  large job  log.   In
       many cases you should  be able to avoid printing the  job log by
       just reviewing the displayable information.

  **   Job logs  from multiple systems  can be kept on  a single system
       in  the same set  of data base  files.  The  system name is part
       of the key to allow a review by system name.

  **   A space saving  will most likely  occur versus any other  method
       of  keeping  the  same   job  log  information  on  the  system.
       However,  you will  probably offset  any gain by  increasing the
       number of  job  logs that  you keep  online.   You  can  further
       reduce the space required by:

         --   Tailoring the  amount of  message text  that will  appear
              in  the file.   See the discussion  on Eliminating excess
              message text.

         --   Eliminating some job logs by  specifying a list of  users
              or generic  user names  to be  omitted.   An option  also
              exists to  delete these job  logs if a  normal completion
              has  occurred.  For example, you  can delete any job logs
              for jobs that have  completed normally for users such  as
              QSYS, QUSER, QSPLJOB, etc.

              A  separate option  allows you  to convert  the  job logs
              caused by abnormal completions for the omitted users.

         --   Eliminating  some job logs  by specifying a  list of jobs
              or generic  job names  to  be omitted.   An  option  also
              exists to  delete these job  logs if a  normal completion
              has occurred.   For example, you can  delete any job logs
              for jobs that  have completed normally  for jobs such  as
              QBASE and QSYSWRK.

              A separate  option  allows you  to convert  the job  logs
              caused by abnormal completions for the omitted jobs.

Command overview
----------------

   CRTJLGCTL     The  Create Job Log  Control command creates  the data
                 base  files  used by  the other  commands.   A library
                 for the files is  named.  You can have  multiple sets,
                 but only one per library.

   CVTJLGCTL     The Convert  Job Log Control command  converts the job
                 log  spooled  files  to the  set  of  data  base files
                 created.   An option  on the  command allows  deletion
                 of each job log that is converted.

                 If  the  job  is  still active  or  has  already  been
                 converted,  the job  log is  not  converted.   See the
                 later discussion of 'What files are converted'.

                 An  option  exists  to   eliminate  excess  lines   of
                 message   text.     See   the  later   discussion   of
                 'Eliminating excess message text'.

                 An  option exists  to omit  spooled  files owned  by a
                 list  of users  or by  a list of  job names.   See the
                 later discussion of 'Omitting Users or Jobs'.

   PRTJLGCTL     The Print Job Log  Control command prints the job  log
                 in  the same  format as  it was  originally.   Options
                 exist  to print less  than a full job  log by printing
                 a range of  messages, specific  message types, or  the
                 special  value *NETLOG  which  attempts  to 'net  out'
                 the job log to only significant information.

   DSPJLGCTL     The  Display   Job  Log  Control  command  displays  a
                 subfile with one  record by job  name.  Options  allow
                 you  to display  the  heading information,  print  the
                 job  log, or  display  the  messages in  the  job log.
                 The   display  messages   option  provides   a  second
                 subfile  with  one record  per  message.    An  option
                 allows you to  see the details of the  message (it can
                 be many text lines).

   MTNJLGCTL     The  Maintain Job Log Control  command removes old job
                 logs from the  data base  files based on  a number  of
                 retention   days.     The  command   should  be   used
                 periodically for cleanup.

   PRTJLGCTLS    The  Print Job  Log Control  Summary command  prints a
                 listing by date, job, or  user with one line per  job.

   RTVJLGCTLC    The Retrieve Job  Log Control Completion  code command
                 retrieves the completion code for a specific job.

Physical files
--------------

The following physical files are created by the CRTJLGCTL command:

   JLGMSTP       The  Job Log Control  Master file  has one  record per
                 job log.

   JLGMSGP       The  Job Log Control  Message file has  one record per
                 message  that exists  in  the  job  log  when  it  was
                 converted.   This includes  the first line  of message
                 text.

   JLGOFLP       The  Job Log Control Overflow file  has one record for
                 every line of message text  after the first.  See  the
                 discussion  of 'Eliminating  excess  message text'  to
                 help control the size of this file.

   JLGSRCP       The  Job   Log  source  file  is  used  for  exception
                 message IDs  to limit  the records  in JLGOFLP.    See
                 the discussion  on 'Eliminating  excess message  text'
                 for how to use this file.

Logical files
-------------

The following logical files are created by the CRTJLGCTL command:

     File        Based on     Description
     ----        --------     -----------

     JLGMSGA     JLGMSGA      Arrival sequence
     JLGMSTA     JLGMSTP      Arrival sequence
     JLGMSTL     JLGMSTP      Keyed by System, Date, Time
     JLGMSTM     JLGMSTP      Keyed by System, Date, Job
     JLGMSTX     JLGMSTP      Keyed by System, Job, Date, Time
     JLGMSTY     JLGMSTP      Keyed by System, User, Date, Time

The  Date/Time fields refer  to the  Job Log  open date/time.   This is
the  date/time the  QPJOBLOG spooled  file was  opened and  is normally
the date/time that the  job ended.  The date/time values  are extracted
from the  information in the output  queue when CVTJLGCTL is  run.  For
a  further understanding  of  the keys  used, see  the section  on 'Key
Usage'.

Getting started with Job Log Control
------------------------------------

The CRTJLGCTL  command must  be used  first to  create the  files in  a
specific library such as:

       CRTJLGCTL    JLGCTLLIB(xxx)

Nightly  or   periodically,  the  CVTJLGCTL   command  would   be  run.
Normally  this  would be  run  against the  QEZJOBLOG  output  queue in
QUSRSYS or  wherever  your  job  log  spooled  files  are  written  to.
Assume you  want to  delete the  job log  as soon as  it is  converted.
The command would be:

      CVTJLGCTL    OUTQ(QEZJOBLOG) DLTCVTJLG(*YES)

The  command defaults  to find the  JLGCTL files  on the  library list.
When  the command completes, all the job  logs that were in the correct
status would  be  converted to  the  JLGCTL data  base files  and  then
deleted.    A  report  is  printed describing  what  happened  to  each
spooled  file found  and the  number of records  in the  critical files
and the end of conversion.

If you  want to re-print  a job  log, the  easiest solution  is to  use
DSPJLGCTL which  provides a  subfile of job  logs.   DSPJLGCTL provides
several  access paths to  access the same  information such as  by Job,
by user, by date, etc.  A  simple option from the subfile display  will
re-print the job log.

To use DSPJLGCTL specify:

       DSPJLGCTL

In  many cases  you  will probably  not  have to  reprint  the job  log
because  you can  find  what  you are  looking  for by  looking  at the
information on the displays.

If  you know the qualified name of the  job log that you want to print,
you can  do so directly  with the  Print Job  Log Control command  such
as:

        PRTJLGCTL   JOB(123456/QPGMR/JOBA)

Reviewing a large  printed job log can be very  awkward.  The PRTJLGCTL
command supports several options to minimize printing such as:

        - Only specific message types such as *RQS and *ESCAPE.
        - Messages within a range of message numbers (the numbers
            are shown on the subfile display).
        - The last N messages in the job log.
        - The special value *NETLOG which attempts to 'net out'
            the job log for what users typically look for.
        - Truncating excess long messages

For  example, to print  the last 100  messages found in a  job log, you
would specify:

        PRTJLGCTL   JOB(123456/QPGMR/JOBA) FROMMSGNBR(-100)

You will need to  try some of the  different options to determine  what
typically works best for you.

You will  want to periodically  clean out old  versions of the  Job Log
Control  files  by  specifying  a  number  of  retention  days  on  the
MTNJLGCTL command such as:

         MTNJLGCTL    RMVDAYS(14)

This would remove  all of  the job  log information where  the job  log
open date was  more than 14 days  old.  A report is  printed describing
the  number of records  that existed  before and  after in each  of the
critical physical files.

Job logs are not a perfect audit trail
--------------------------------------

From  an auditability viewpoint, a job log  leaves a lot to be desired.
Messages can be easily  removed or the entire  job log can be  deleted.

While  the information  in  the job  log  can be  very helpful  solving
problems,  you should look to  the Audit Journal  functions if you have
a strong security need.

Eliminating excess message text
-------------------------------

Many system messages  have a great  deal of second  level text that  is
identical for  every message.   You  can reduce  the amount of  storage
required to  hold the job logs by  eliminating some of this redundancy.

Unlike messages in  message files, the  information in the  job log  is
the complete  message text  and does  not include a  data structure  of
message data.

It  may not  be appropriate to  eliminate all  second level  help text.
Many  message  descriptions have  message data  which is  inserted into
the second level help text.

The JLGCTL  function defaults to  store all message  text found in  the
job log.   Options exist to reduce  the amount of message  text that is
stored.

To  understand the  options, the  CPF1164 message will  be used.   This
message  normally  appears  in  every  complete  job  log  as  the  job
completion message.   If you look at  a job log for  this message while
you  are  reading  this  section,  you  will  probably  understand  the
options better.

In the  job log  for  the CPF1164  message,  the 'Message'  section  is
normally 2  lines and contains  the information  about the ending  code
and the  number of seconds.   The 'Cause' section is  normally 13 lines
and  repeats  the  ending  code  and  number  of  seconds  as  well  as
describing when  the job  ended.  The  major part  of the  13 lines  is
devoted to an  explanation of the 'ending codes' which  is the same for
every occurrence of the message.

Thus  every CPF1164  message would  cause one record  be stored  in the
JLGMSGP file  which contains  the first  line of  text  and 14  records
(the 2nd  record from  the 'Message'  section and  13 from the  'Cause'
section) in the JLGOFLP file.

You  could save  significant storage space  by eliminating  the 'ending
code' descriptions as they are identical for every CPF1164 message.

The 'ending  date  and  time'  described  in  the  'Cause'  section  is
essentially  duplicated  in   the  message  heading  record   (one  per
message)  with  JLGCTL.   Because  the  system ends  the  job and  then
prints  the job log, the  time that the CPF1164 message  is sent to the
job log  will  be either  the  same or  greater  than the  ending  time
specified in the text of the CPF1164 message.

Therefore,  for the  CPF1164  message  you could  specify  that only  2
lines  of text be captured and avoid  storing the redundant 13 lines of
text for every message.

Here are  some  other typical  examples of  where  you can  reduce  the
amount  of storage  used for  the overflow  messages and  not lose  any
important  information.    The  following  messages  have one  or  more
'Cause' lines  that  do  not  add anything  of  value  over  the  first
'Message' line:

       CPC2101    Library list changed
       CPC2198    Current library changed to xxxx
       CPF0001    Error found on CALL command

For these types  of messages, you  could save space by  specifying that
zero lines of overflow message text be kept.

There are two methods of reducing the amount of storage required.

   MAXOFLLINS    The  MAXOFLLINS  parameter  on  CVTJLGCTL acts  as  an
                 upper  limit for the  number of lines  stored for each
                 message.   It  defaults to  *MAX meaning  all  message
                 lines  would be  captured.   If  you  specify a  value
                 like  10,  only  the first  10  lines  of  any message
                 would be  captured.    This  would  eliminate  storing
                 lines 11-14  of each  CPF1164 message  as well  as any
                 other long text message.

   SRCFILE       The  CVTJLGCTL  command  processing  first  looks  for
                 specific message IDs in  a source file named  JLGSRCP.
                 The file is  automatically created by CRTJLGCTL.   You
                 enter specific  message IDs and the  number of message
                 text lines that you want to limit the text for.

                 To enter the exception messages do the following:

                    STRSEU    SRCFILE(xxx/JLGSRCP) SRCMBR(JLGSRCP)

                 Enter  one source statement per  MSGID exception.  The
                 MSGID  should  be placed  in  positions  1-7  and  the
                 number  of  lines  you  want  to keep  for  JLGCTL  in
                 position 9.  For example, it might look like:

                         Pos 1     7 9

                             .     . .
                             .     . .
                             CPC2101 1
                             CPC2198 1
                             CPD4033 4
                             CPF0001 1
                             CPF1164 2
                             CPF2451 1

If  a  MSGID exists  that is  not  in the  exception  list, it  will be
stored in full unless controlled by the MAXOFLLINS value.

After you gain some  experience with JLGCTL, you  can run some  queries
over the  JLGOFLP file to  determine what specific  MSGIDs you  want to
enter into the JLGSRCP file.

Omitting Users or Jobs
----------------------

You  may avoid the  conversion of job  logs owned by  specific users or
by specific job  names.   The CVTJLGCTL command  supports the  OMITUSER
and OMITJOB  parameters to allow  up to  300 users and  300 jobs to  be
omitted.  Both the user names and job names may be generic.

Two other parameters are associated with the OMITUSER parameter:

  **   The  OMITCVTCTL  parameter  may  be  specified to  *ABNORMAL  to
       convert  the  job  logs if  an  abnormal completion  of  the job
       occurred.  An abnormal completion  is defined as any job  with a
       completion code greater than 00.

  **   The  OMITDLTCTL parameter  may be  specified to  *YES  to delete
       the job logs.

For  example, assume you want  to omit converting  any job logs created
by the  system users  QSYS, QUSER,  and QSPLJOB  unless  the job  ended
abnormally.   In addition,  you want  to delete any  job logs  that are
converted  and  any for  users  specified  to be  omitted.    You would
specify:

             CVTJLGCTL    OUTQ(QEZJOBLOG) DLTCVTJLG(*YES)
                            OMITUSER(QSYS QUSER QSPLJOB)
                            OMITCVTCTL(*ABNORMAL) OMITDLTCTL(*YES)

Two similar parameters  (OMTCVTCTLJ and  OMTDLTCTLJ) for  the jobs  you
have specified to be omitted.

What files are converted
------------------------

You  may name  any output  queue  to be  converted,  but the  following
rules apply:

  **   Only  spooled files  named  QPJOBLOG  will be  considered.   Any
       other spooled file names are bypassed.

  **   Only  those spooled files in  a status of RDY,  CLO, HLD, or SAV
       are considered.  Any other status is bypassed.

  **   If the job is not  active and the fully qualified job  name does
       not exist in JLGCTL, the spooled file is converted.

  **   If the  job is  still active,  the job logs  is bypassed.   This
       could  occur if  DSPJOBLOG OUTPUT(*PRINT)  was used and  the job
       was still active.

  **   If the job log already exists  in the JLGCTL files, the job  log
       will normally  be bypassed.   This  would occur  if you did  not
       delete the job log when CVTJLGCTL was first used.

       There is  an exception if the  spool file number of  the job log
       in the  output queue  (for the  same job)  is  greater than  the
       spool file  number  of the  job log  that was  converted.   This
       could  occur if the  DSPJOBLOG OUTPUT(*PRINT)  was used  and the
       job  was no longer  active when CVTJLGCTL was  run.  The partial
       job log would be converted.

       If at a later  point, the complete job  log was output and  then
       CVTJLGCTL was  run, it  would sense the  fact that  the complete
       job  log was for a later time.   The processing would delete the
       master record  for the  partial  job log  and then  convert  the
       more current job log.

       Note that  the records  in the other  files associated  with the
       deleted  master  record   are  not  deleted.    They  cannot  be
       accessed using the  JLGCTL commands.   They will  be deleted  by
       MTNJLGCTL at the specified retention date.

Security
--------

The user  who uses  CRTJLGCTL becomes  the owner  of the  files in  the
specified  library.   The *PUBLIC  is authorized  to *USE  authority to
the files.  You may change the authority for your own requirements.

  **   CRTJLGCTL requires the special authority *JOBCTL.

  **   CVTJLGCTL  requires  *CHANGE  authority  to  the  files  and the
       special authority *JOBCTL.

  **   MTNJLGCTL requires *OBJMGT authority to the files.

  **   DSPJLGCTL, PRTJLGCTL, and  PRTJLGCTLS require *USE  authority to
       the files.

The commands are all authorized for *PUBLIC use.


Unit of Work Information
------------------------

Some  job  logs  for  APPN   type  jobs  may  contain  'Unit  of  Work'
information  at the  top  of the  job log.    When CVTJLGCTL  runs, the
information is retained in the  special messages TAA5001, TAA5002,  and
TAA5003.

When DSPJLGCTL  is used, these messages  appear as if they  were actual
messages in  the job log.  The Unit of  Work information can be seen by
displaying the detail screen for each message.

When PRTJLGCTL is  used, the  messages are  converted so  that the  job
log appears as it did originally without the special messages.

CRTJLGCTL Command parameters                           *CMD
----------------------------

The CRTJLGCTL  command creates the  files described previously  for the
Job Log control tool.

   JLGCTLLIB     The  library name  where  the JLGCTL  files  should 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.

CVTJLGCTL Command parameters                           *CMD
----------------------------

The  CVTJLGCTL command  converts  the  job logs  found  in a  specified
output  queue and  converts  them to  the JLGCTL  files in  a specified
library.   See  the  section  on  'What  files  are  converted'  for  a
complete understanding.

   OUTQ          The  qualified  name   of  the  output  queue   to  be
                 converted.   The library  defaults to  *LIBL.  *CURLIB
                 may also be used.

   DLTCVTJLG     Whether  to  delete  the  converted  job  log  spooled
                 files.   Once the spooled  file is converted,  you can
                 re-print  the  job log  with  the  JLGCTL  tool.   The
                 default is *NO.

                 *YES  must be  specified to  delete the  job logs that
                 are converted on this  use of CVTJLGCTL.  It  does not
                 delete  job  logs  that  have already  been  converted
                 using DLTCVTJLG(*NO).

                 *YES2  may be  specified to  delete job logs  that are
                 converted by  both  this  use of  CVTJLGCTL  and  also
                 those that  were converted  by a  prior use, but  were
                 retained by the use of DLTCVTJLG(*NO).

                 If  OMITCVTCTL  is  specified  as  *ABNORMAL, any  job
                 logs  caused  by  users  specified  for  the  OMITUSER
                 parameter  will   be  converted   if  the  job   ended
                 abnormally.    DLTCVTJLG(*YES or  *YES2)  also applies
                 to these job logs.

                 If  OMTCVTCTLJ  is  specified  as  *ABNORMAL,  any job
                 logs  caused  by   jobs  specified  for  the   OMITJOB
                 parameter   will  be  converted   if  the   job  ended
                 abnormally.    DLTCVTJLG(*YES or  *YES2)  also applies
                 to these job logs.

   MAXOFLLINS    The maximum  number of  message overflow  lines to  be
                 converted.    For  example,  if  10  is  entered,  any
                 message  text lines  from the job  log that  exceed 10
                 for  any  single  message  would  not  appear  in  the
                 JLGCTL  files.   See  the discussion  on  'Eliminating
                 excess  message text' for  a further  understanding of
                 this parameter.

   OMITUSER      A  list of  up to 300  users (or generic  users) to be
                 omitted.   The default  is *NONE which  means all  job
                 log owners are eligible for conversion.

                 If a  user is listed, any  job logs owned by  the user
                 will  not be  converted.   This may  be used  to avoid
                 converting job logs owned  by system profiles such  as
                 QSYS,  QSPLJOB, etc.   An  exception  exists with  the
                 OMITCVTCTL parameter.

   OMITCVTCTL    Whether  the  job log  should be  converted  for users
                 specified in the OMITUSER  parameter if the job  ended
                 abnormally.  The  default is *NONE which  prevents any
                 job logs for omitted users from being converted.

                 If  *ABNORMAL  is specified,  the  completion code  of
                 the   job   is  checked.      If  the   job  completed
                 abnormally, (Completion  code  greater than  00),  the
                 job log will be converted.

   OMITDLTCTL    A *YES/*NO  option for whether  to delete the  job log
                 for  a user specified in the  OMITUSER parameter.  *NO
                 is the default to retain these job logs.

                 *YES may be  specified to  delete the job  log if  the
                 job  log  is  not  converted.    If  the  job  log  is
                 converted   based   on   the   OMITCVTCTL   parameter,
                 deletion of  the  job  log is  under  control  of  the
                 DLTCVTJLG parameter.

   OMITJOB       A list of up  to 300 job names (or  generic job names)
                 to be  omitted.  The default is  *NONE which means all
                 job names are eligible for conversion.

                 If  a job  is listed, any  job logs with  the same job
                 name will  not  be converted.   This  may  be used  to
                 avoid converting  job logs such as  QBASE and QSYSWRK.
                 An exception exists with the OMTCVTCTLJ parameter.

   OMTCVTCTLJ    Whether  the  job should  be converted  for  job names
                 specified in the  OMITJOB parameter  if the job  ended
                 abnormally.  The  default is *NONE which  prevents any
                 job logs for omitted jobs from being converted.

                 If  *ABNORMAL  is specified,  the  completion  code of
                 the  job   is  checked.      If  the   job   completed
                 abnormally,  (Completion code  greater  than 00),  the
                 job log will be converted.

   OMTDLTCTLJ    A *YES/*NO  option for whether  to delete the  job log
                 for  a job  specified in  the OMITJOB  parameter.  *NO
                 is the default to retain these job logs.

                 *YES may  be specified to  delete the  job log if  the
                 job  log  is  not  converted.    If  the  job  log  is
                 converted   based   on   the   OMTCVTCTLJ   parameter,
                 deletion of  the  job  log  is under  control  of  the
                 DLTCVTJLG parameter.

   JLGCTLLIB     The  library name  where  the  JLGCTL files  exist  as
                 created   by  CRTJLGCTL.     *LIBL  is   the  default.
                 *CURLIB may also be specified.

   CVTNBR        The number of  job logs  to convert.   The default  is
                 *MAX for all job logs.

                 A  number may  be  entered to  allow  only a  specific
                 number  of  job  logs   to  be  converted.    This  is
                 designed as a testing option.

PRTJLGCTL Command parameters                           *CMD
----------------------------

The  PRTJLGCTL command prints the information  from the JLGCTL files in
the same format as a system  job log.  The user of the  command becomes
the owner  of the spooled  file.  Options  exist to control  the amount
of printing.

   JOB           The  qualified name of the job  containing the job log
                 to be  printed.   All  3 values  (job, user,  and  job
                 number) must be entered.

   SYSNAME       The name  of the  system that  converted the job  log.
                 The default is *CURRENT.

                 If  you  have multiple  systems, you  can  convert the
                 job logs  on separate  systems  and combine  the  data
                 into a  single set  of files  on one system.   If  you
                 combine  the output  from multiple  systems,  then you
                 must  specify a system  name to access  a job log from
                 a system other than the current system.

   HEADING       The default is  *TAA which  prints information on  the
                 heading  line  that  the  job  log  was  printed  from
                 JLGCTL.

                 *STD  may  be  entered to  print  the  text  'Job Log'
                 which can  make  the job  log  appear identical  to  a
                 system created job  log.  If you want to  make the job
                 log  a duplicate  of system  function, you  should not
                 remove any message lines  as described in the  section
                 on  'Eliminating  excess  message  text'  or  use  the
                 selection parameters on this command.

   MSGTYPE       The  message  types  that  you  want to  print.    The
                 default is *ALL to print all message types.

                 A  list of values may  be specified for *RQS, *ESCAPE,
                 *DIAG,  *INFO,  *SENDER,  *REPLY,  and  *COMP.     For
                 example, you  could specify just  the *ESCAPE messages
                 or both the *RQS and *ESCAPE message types.

                 The  special value *NETLOG may also  be specified.  It
                 attempts to  net  out the  job  log by  printing  only
                 certain message  IDs and certain  message types.   The
                 message  types   CPF1124  (job  start),  CPF1164  (job
                 end), and  CPI1125  (SBMJOB  information)  are  always
                 printed.   Any *RQS or  *ESCAPE messages  are printed.
                 If  a *DIAG message  precedes an *ESCAPE  message, the
                 *DIAG message is printed.

   FROMMSGNBR    The  From  Message  Number  to  start  printing.   The
                 Message  Numbers  are  those  assigned  internally  by
                 JLGCTL and  appear when you display the  subfile for a
                 job  log.   The  default is  1 to  start at  the first
                 message.

                 You may  start  at a  specific  number, but  you  will
                 need  to review  the  subfile to  determine where  you
                 want to start.

                 If  a  negative  value is  entered  such  as -100,  it
                 means to print the last  100 messages in the job  log.
                 Usually  this can  be  very effective  in  determining
                 why  a  job  abnormally  terminated.   If  a  negative
                 value  is entered,  TOMSGNBR(*MAX) must  be specified.

   TOMSGNBR      The To  message number to  print to.   The default  is
                 *END  meaning  to  print   to  the  last  record.    A
                 specific value may be entered.

   MAXOFLLINS    The  maximum number of  overflow lines to  print.  The
                 default is *MAX  which will  print all  of the  stored
                 overflow  text  lines.    If a  value  such  as  6  is
                 entered,  any  overflow text  lines  after  6 for  any
                 message would not appear.

   JLGCTLLIB     The library  name  where  the JLGCTL  files  exist  as
                 created  by   CRTJLGCTL.     *LIBL  is  the   default.
                 *CURLIB may also be specified.

DSPJLGCTL Command parameters                           *CMD
----------------------------

The DSPJLGCTL  displays a subfile with one line  per converted job log.
The  initial display appears  in sequence by System,  Job Log open date
(normally job end date),  and Job name.   You can 'Position To'  within
the display or change to an alternate access path.

   JLGCTLLIB     The  library  name where  the  JLGCTL  files exist  as
                 created   by  CRTJLGCTL.     *LIBL  is   the  default.
                 *CURLIB may also be specified.

   SEQ           The sequence of the display.   The default is  *DATJOB
                 to  sequence  by system,  date,  and  job.   Once  the
                 display  appears, you may  change the  sequence by use
                 of F9.

                 *JOBDAT may  be entered  to sequence  by system,  job,
                 and date.

                 *USER  may be  entered to  sequence  by system,  user,
                 date, and time.

                 *DATTIM  may be entered  to sequence by  system, date,
                 and time.

MTNJLGCTL Command parameters                           *CMD
----------------------------

The  MTNJLGCTL  command cleans  out old  job  log information  from the
JLGCTL files based  on a 'number of  days' parameter.  See  the section
on 'MTNJLGCTL Recovery' if recovery is needed.

   RMVDAYS       The  number of days  old to  remove job  logs.   14 is
                 the  default which means that  any job log information
                 that is older than 14 days ago will be removed.

   JLGCTLLIB     The library  name  where  the JLGCTL  files  exist  as
                 created  by   CRTJLGCTL.     *LIBL  is   the  default.
                 *CURLIB may also be specified.

MTNJLGCTL Recovery
------------------

The  MTNJLGCTL command  removes old  job log  information based  on the
value for the RMVDAYS parameter.   The technique used is to copy  those
records which  should be retained  to backup files  and then copy  back
into cleared members.

Each of  the 3 main  physical files has  a second member  named BACKUP.
The  MTNJLGCTL  command  determines  the retention  date  based  on the
RMVDAYS parameter and  then selectively copies  each of the files  from
the first member to the corresponding BACKUP member.

The  files (first  members of  each) are  then cleared  and  the BACKUP
member  is copied back.   This  nets out the  file to  contain only the
records which have  a Job Log Open  date greater than  or equal to  the
retention date.  The backup members are then cleared.

During  the processing,  a data  area  JLGRECOV is  updated as  various
steps  are completed.    If the  command fails  during  processing, you
should be able  to issue  the command  again and  have it  successfully
recover.

PRTJLGCTLS Command parameters                          *CMD
-----------------------------

The PRTJLGCTLS command prints  a summary of one line per  job by either
date, job, or user.

   JOB           The name to be listed.  The default is *ALL.

   USER          The user to be listed.  The default is *ALL.

   SYSNAME       The  name of the  system that  converted the  job log.
                 The default is *CURRENT.

   STRDATE       The  start date to  access the jobs  for.  The default
                 is *BEGIN meaning  the first date  that exists.  If  a
                 date is entered, job format must be used.

   ENDDATE       The end date  to access the jobs for.   The default is
                 *END  meaning the  last date that  exists.   If a date
                 is entered, job format must be used.

   STRTIME       The start time  to access the jobs  for.  The  default
                 is *BEGIN  meaning the first time  that exists.   If a
                 time is entered, it must be in valid time format.

   ENDTIME       The end  time to access the jobs  for.  The default is
                 *END meaning the  last time  that exists.   If a  time
                 is entered, it must be in valid time format.

   SEQ           The sequence of the listing.

                 *DATE is  the default to  cause the  listing to be  in
                 date order.

                 *JOB  may be  entered to  cause the  listing to  be in
                 job order.

                 *USER  may be  entered to cause  the listing  to be in
                 user order.

   TYPE          The type of listing to be output.

                 *DETAIL causes one  line per  job with summary  totals
                 depending on the sequence.

                 *TOTAL  causes one summary  line per  sequence change.

   JLGCTLLIB     The  library  name  where the  JLGCTL  files  exist as
                 created  by  CRTJLGCTL.     *LIBL   is  the   default.
                 *CURLIB may also be specified.

RTVJLGCTLC Command parameters                          *CMD
-----------------------------

The RTVJLGCTLC command retrieves the completion code of the job.

   JOB           The fully qualified  job name of the job.   All values
                 must be entered.

   CMPCDE        The completion  code that is returned.   A 2 character
                 value  will  be  returned  as  found  on  the  CPF1164
                 message.

   SYSNAME       The name  of the  system that  converted the job  log.
                 The default is *CURRENT.

   JLGCTLLIB     The  library  name where  the  JLGCTL  files exist  as
                 created   by  CRTJLGCTL.     *LIBL   is  the  default.
                 *CURLIB may also be specified.

Combining job logs from multiple systems
----------------------------------------

Job Log  control  allows you  to  store the  job  log information  from
multiple systems in  the same set of data base files.   Each keyed file
has a high order key of SYSTEM name.

To  add records  from another  system, you should  do CVTJLGCTL  on the
remote system.    Then  transfer  the  three  physical  files  JLGMSTP,
JLGMSGP, and  JLGOFLP to  the central system.   CPYF  could be  used to
add the  records from each of  the three files to  the combined file on
the central system.

Important Key Fields to the Files
---------------------------------

Several important keys  are used within  the JLGCTL files  to link  the
records together.

   System        The system name  is the high  order key to  most files
                 to  allow the  separation of  job names,  job numbers,
                 etc.   This  is the system  the job  log was converted
                 on by the CVTJLGCTL command.

   Qlfd job      The  fully qualified  job  name  is  used  for  normal
                 access to the JLGMSTP file.

   Open date     The date  the job  log was opened  is used as  a major
                 key  to  the JLGMSGP  file.   This  date  is available
                 from the system when  the spooled files are  processed
                 and provides a consistent field.

   TAA Job nbr   An internal consecutive  number is used to  number the
                 jobs.   The  number begins  with 1  for the  first job
                 log of  each  date  (job log  open  date)  and  allows
                 9,999,999 jobs during the day.

   TAA Msg nbr   An internal consecutive  number is used to  number the
                 messages within  a job log.   This number  begins with
                 1  for the  first message  converted from  the job log
                 and allows for  9,999,999 messages in single  job log.
                 The  number  can  be  seen  and  referenced  from  the
                 detail  subfile display.   It can be  specified on the
                 PRTJLGCTL command.

System serial number field in TAALOGBP
--------------------------------------

The system serial  number field  JLSRLN is accessed  by CVTJLGCTL  from
the heading line at the top of each job log page.

The i5/OS  program that  prints the  job log  accessed the  information
using an  internal program.  The program  intended to access the system
name  (not  the  serial  number),   but  instead  accessed  the   value
associated with LCLLOCNAME.   In the  releases beginning with  V3R2 and
V3R7, the internal program was changed to access the system name.

The  JLGCTL tool was  written before the  change was made.   Therefore,
the  definition of  the JLSRLN  field varies  depending on  the release
and if an entry was specified for LCLLOCNAME.

Both system  name and system  serial number  are 8 bytes  in length  so
the same field name holds either data.

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

  **   See the security section for security implications.

  **   Because  the job  log must  be copied  to a  data base  file and
       then  read  by  a program,  the  command  is  release dependent.
       Only the  lower and  upper case  English  language versions  are
       supported.   If the printed format  of the job log  changes, the
       program to read the printed output may have to be changed.

  **   The  RTVJLGCTLC command  may only  be used  for lower  and upper
       case English language versions.

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

The following TAA Tools must be on your system:

     ADDDAT          Add date
     CHKJOBCTL       Check job control special authority
     CVTOUTQ         Convert output queue
     EDTVAR          Edit variable
     EXTLST          Extract list
     FILEFDBCK       File feedback data structure
     HLRMVMSG        HLL Remove message
     RTVJOBSTS       Retrieve job status
     RTVSYSVAL3      Retrieve system value 3
     SNDCOMPMSG      Send completion message
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     TAAARC          TAA Archive
     WRTSRC          Write source

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

None, the tool is ready to use.

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

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

   CVTJLGCTL     *CMD                   TAALOGB       QATTCMD
   CRTJLGCTL     *CMD                   TAALOGB2      QATTCMD
   MTNJLGCTL     *CMD                   TAALOGB3      QATTCMD
   PRTJLGCTL     *CMD                   TAALOGB4      QATTCMD
   DSPJLGCTL     *CMD                   TAALOGB5      QATTCMD
   PRTJLGCTLS    *CMD                   TAALOGB6      QATTCMD
   RTVJLGCTLC    *CMD                   TAALOGB7      QATTCMD
   TAALOGBC      *PGM       CLP         TAALOGBC      QATTCL
   TAALOGBC2     *PGM       CLP         TAALOGBC2     QATTCL
   TAALOGBC3     *PGM       CLP         TAALOGBC3     QATTCL
   TAALOGBC4     *PGM       CLP         TAALOGBC4     QATTCL
   TAALOGBC5     *PGM       CLP         TAALOGBC5     QATTCL
   TAALOGBC6     *PGM       CLP         TAALOGBC6     QATTCL
   TAALOGBC7     *PGM       CLP         TAALOGBC7     QATTCL
   TAALOGBC9     *PGM       CLP         TAALOGBC9     QATTCL
   TAALOGBC11    *PGM       CLP         TAALOGBC11    QATTCL
   TAALOGBC17    *PGM       CLP         TAALOGBC17    QATTCL
   TAALOGBR      *PGM       RPG         TAALOGBR      QATTRPG
   TAALOGBR3     *PGM       RPG         TAALOGBR3     QATTRPG
   TAALOGBR4     *PGM       RPG         TAALOGBR4     QATTRPG
   TAALOGBR5     *PGM       RPG         TAALOGBR5     QATTRPG
   TAALOGBR6     *PGM       RPG         TAALOGBR6     QATTRPG
   TAALOGBR7     *PGM       RPG         TAALOGBR7     QATTRPG
   TAALOGBR9     *PGM       RPG         TAALOGBR9     QATTRPG
   TAALOGBD      *FILE      DSPF        TAALOGBD      QATTDDS
   TAALOGBE      *FILE      DSPF        TAALOGBE      QATTDDS
   JLGMSTP       *FILE      PF          TAALOGBP      QATTDDS
   JLGMSGP       *FILE      PF          TAALOGBQ      QATTDDS
   JLGOFLP       *FILE      PF          TAALOGBT      QATTDDS
   JLGMSTA       *FILE      LF          TAALOGBA      QATTDDS
   JLGMSTM       *FILE      LF          TAALOGBM      QATTDDS
   JLGMSTL       *FILE      LF          TAALOGBL      QATTDDS
   JLGMSGA       *FILE      LF          TAALOGBW      QATTDDS
   JLGMSTX       *FILE      LF          TAALOGBX      QATTDDS
   JLGMSTY       *FILE      LF          TAALOGBY      QATTDDS
   JLGRECOV      *DTAARA

Structure
---------

CRTJLGCTL   Cmd
   TAALOGBC2  CL pgm

CVTJLGCTL   Cmd
   TAALOGBC    CL pgm
     TAALOGBC11  CL pgm - Retrieves completion code from job log
     TAALOGBR    RPG Pgm

MTNJLGCTL   Cmd
   TAALOGBC3   CL pgm
     TAALOGBR3   RPG Pgm

PRTJLGCTL   Cmd
   TAALOGBC4   CL pgm
     TAALOGBR4   RPG Pgm

DSPJLGCTL   Cmd
   TAALOGBC5   CL pgm
     TAALOGBR5   RPG Pgm  - Displays subfile one job per line
       TAALOGBC9   Cl Pgm  - Does prompt for PRTJLGCTL
       TAALOGBC17  Cl Pgm  - Accesses RTVJLGCTLC
       TAALOGBD    Display file
       TAALOGBR9   RPG Pgm - Displays subfile one msg per line
         TAALOGBC9   Cl Pgm
         TAALOGBE    Display file

PRTJLGCTLS  Cmd
   TAALOGBC6   CL pgm
     TAALOGBR6   RPG Pgm

RTVJLGCTLC  Cmd
   TAALOGBC7   CL pgm
     TAALOGBR7   RPG Pgm
					

Added to TAA Productivity tools May 1, 1996


Home Page Up to Top