TAA Tools
CHKINACT2       CHECK INACTIVE 2                       TAAJOEJ

The Check Inactive  Job 2 tool is  a series of commands that  allow the
ending  or  disconnecting  of  jobs  that  have  been  inactive  for  a
specified  period of  time.   This allows  security control  when users
walk away from  their devices while  still signed on.   It may also  be
used  to  end jobs  that  are hung.    CHKINACT2  allows for  different
timeout values while the CHKINACT tool has a single timeout value.

While   CHKINACT2  is  primarily  intended   for  interactive  jobs,  a
solution for batch jobs (including pre-start jobs) also exists.

Exceptions may be entered into a data base file:

  **   Devices that should be  ignored such as  where the device is  in
       a secure area.

  **   Varying the timeout period for different jobs or users.

  **   Requesting either ENDJOB or DSCJOB (Disconnect Job).

  **   Requesting a user program to process the timeout.

  **   Controlling all devices in a subsystem with the same values.

If an  entry is not found  that matches the subsystem,  device/job, and
user, an  application value determines the defaults  that will be used.

Ending the  CHKINACT2 job  produces a  spooled file.   Data  base  file
output is optional.

How the CHKINACT2 tool operates
-------------------------------

Unlike the  system support that  uses the  system values QINACTITV  and
QINACTMSGQ, the  CHKINACT2 tool uses its own  technique for determining
when  an action should be performed.   This allows the timeout value to
vary per subsystem, device, or user.

A batch  job is  submitted by  the SBMINACT2  command.   The batch  job
wakes  up periodically  (based  on your  specification) and  determines
what  jobs exist.   The number  of transactions  and the  amount of CPU
used for interactive  jobs and the  amount of CPU  used for batch  jobs
is compared to the previous values when the last wakeup occurred.

If  no change  has occurred  (meaning  no activity  has occurred),  the
data   base  file   of  exceptions  is   checked  for   the  subsystem,
device/job, and  user.   If a  matching entry  is  found, the  inactive
time allowed  for the entry  is checked against  the last activity  for
the  job.   If the  time is  exceeded, an  action  (such as  ENDJOB) is
performed.   If no matching entry  is found, Application Value defaults
are used.

Because the  batch job  wakes up  only periodically  and determines  if
any  activity has  occurred during  the  interval, there  will be  some
delay  in performing  an action.   For  example, if you  want to  end a
users job  that  has not  been  active for  30  minutes and  the  batch
wakeup period is  5 minutes, the ENDJOB command will  be issued between
30 and 35 minutes.

A  listing is  output  describing each  wakeup period  and  the actions
that have occurred.

The CHKINACT2  batch  job will  normally  appear on  WRKACTJOB  in  the
QSYSWRK subsystem with  a function of DLY-55.   The job wakes  up every
55 seconds  (or the remainder  before the wakeup time)  to determine if
the  ENDINACT2 command  has been  entered (causes  a normal end  of the
job).

The basic support checks  for interactive jobs.  Batch  jobs (including
pre-start jobs) in  named subsystems may also be checked  for.  See the
section on the CHKINACT2 Data Area.

Special  handling of  group jobs  is done  so that  all group  jobs are
considered as one job.  See the section on Group Jobs.

System  request  jobs   that  are  not   active  have  special   system
considerations.  See the section on System Request Jobs.

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

  **   CRTINACT2 Creates the required files in QGPL.

  **   DLTINACT2 Deletes the files created by CRTINACT2.

  **   WRKINACT2 Maintains the file of exceptions.

  **   SBMINACT2 Submits a batch job to monitor for timeouts.

  **   ENDINACT2 Ends the never ending job.

  **   RTVINACT2 Retrieves an entry made by WRKINACT2.

  **   MTNINACT2 Maintains the CHKINACT2S data base file.

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

This section  describes how to  get started using  CHKINACT2 in  a test
mode so that no jobs will be ended or disconnected.

  **   As a user authorized to change system values, enter

             WRKSYSVAL     SYSVAL(QINACTITV)

       The  value should  be set to  *NONE.   This prevents  the system
       from performing  any  activity on  a  timeout as  the  CHKINACT2
       tool will  be used  instead.   QINACTITV is  a 'lockable  system
       value' and  may require the  use of DST/SST to  assist in making
       a  change.  Option  7 will allow  security system value changes.

  **   As  an  *ALLOBJ  user,  use  EDTAPPVAL  to  review/the  defaults
       provided:

             EDTAPPVAL     APPVAL(TAASECURE/CHKINACT2)

Ensure the following values exist:

 Batch job periodic wakeup time 005
 Default inactivity timeout     030
 Default action                 *ENDCTL
 Print option                   *ALL
 Ignore system request jobs     *YES
 Data base option               *NONE
 Data base library              *NONE
 Test option                    *YES
 Disconnect option              999

       The  'Test option' should  be set  to *YES.   This  will prevent
       any action and allow you to test what would have happened.

  **   As an *ALLOBJ user, enter:

             CRTINACT2

       This will create the CHKINA2P and CHKINA2L files in QGPL.

       If  a  user  other  than  the  user  who  used  CRTINACT2 is  to
       maintain the file, he must be given *CHANGE authority such as:

            GRTOBJAUT    OBJ(QGPL/CHKINA2P) OBJTYPE(*FILE)
                           USER(xxx) AUT(*CHANGE)

            GRTOBJAUT    OBJ(QGPL/CHKINA2L) OBJTYPE(*FILE)
                           USER(xxx) AUT(*CHANGE)

  **   As a user with *JOBCTL authority, enter:

            SBMINACT2

       This will submit  the CHKINACT2 batch job  to the QSYSNOMAX  job
       queue.   As per the Application  Value shipped default,  the job
       wakes up every 5 minutes and checks the jobs for activity.

  **   Since  the Application  Value shipped default  is for  a timeout
       after 30 minutes, let the  job run for at  least an hour.   Then
       end the job with:

           ENDINACT2

  **   After  the CHKINACT2  job  ends,  review the  CHKINACT2  spooled
       file.

  **   If  the  Application  Value   field  for  PRTOPT  is  *ALL,  All
       interactive  jobs  will be  listed  at each  5  minute interval.
       Jobs which  had activity  during the timeout  period (30  minute
       default) will be blank in the ACTION column.

       If  the Application Value  PRTOPT field  is *ACTION,  only those
       jobs which have an action will be listed.

       The  jobs which have  had no activity during  the timeout period
       will show  an Action  of  *ENDCTL meaning  the jobs  would  have
       been  ended   by  the   ENDJOB  command   with  OPTION(*CNTRLD).
       Because  the Test  Option  is set  to *YES,  no  ENDJOB commands
       have been  issued.   If  ENDJOB  with OPTION(*CNTRLD)  had  been
       used, a  break message  would occur  at the workstation  stating
       the job would be ended because of inactivity.

       Since the  action has not occurred, you may  see the same job at
       the next wakeup interval specifying the same action.

  **   You  are  now  ready to  review  the options  for  the CHKINACT2
       tool.  There are three forms of options:

         --   Application  Value   CHKINACT2   in  TAASECURE.      This
              controls  the major options  such as  the wakeup  time of
              the batch job and the default action.

         --   The  WRKINACT2   command  maintains  the  file  used  for
              exceptions by  subsystem,  device/job,  and  user.    The
              file is CHKINA2P in QGPL.

         --   A  Constant Array  named  CHKINACT2  exists in  TAASECURE
              that  lets you  define  subsystems containing  batch jobs
              which should also be checked for inactivity.

Application Value CHKINACT2
---------------------------

The Application Value can  be changed or reviewed  by an *ALLOBJ  user.
Any change takes affect at the next wakeup time.

             EDTAPPVAL    APPVAL(TAASECURE/CHKINACT2)

Cursor sensitive help text exists for each option.

The following options are supported.

  **   Batch job periodic wakeup time (WAKEUP)

       The number of minutes  that the CHKINACT2 batch job  should wait
       before  waking up and  determining if  any action  should occur.
       The   default  is   5  minutes.     All   interactive  jobs  are
       considered.     Batch  jobs   in  named   subsystems  are   also
       considered (see the section on 'CHKINACT2 data area'.

  **   Default inactivity timeout (DFTTIME).

       The default  time in minutes that  a job can be  inactive before
       an  action is  performed.   The  default is  used if  a specific
       entry is not found in  the exception file.  The shipped  default
       is 30 minutes.

  **   Default action (DFTACTION).

       The default action to  be performed if no entry  is found in the
       exception  file.  The  default is  *ENDCTL meaning the  job will
       be ended by ENDJOB with OPTION(*CNTRLD).

       *ENDIMM  may   be   specified  to   end   a  job   with   ENDJOB
       OPTION(*IMMED).

       *DSCJOB may be  specified to run  the DSCJOB command.   See also
       the Disconnect Option (DSCOPT) parameter.

       *IGNORE  may  be  specified to  ignore  the  job  (no action  is
       performed).

       *PGM  may  be specified  to  invoke a  program.   See  the later
       section on 'Invoking a program'.

  **   Print option (PRTOPTION).

       The type  of  printing that  should be  performed  for any  jobs
       found.

       *ALL is the  default which will list each  interactive job found
       and  any   batch  jobs  from  specified  subsystems.    *ALL  is
       intended for use when you are initially testing.

       *ACTION may  be  specified to  list  only  those jobs  where  an
       action will be performed.

       *ENDDSC  (End or  Disconnected) may  be specified  to list  only
       those jobs  where an action other than  *IGNORE occurred.  After
       using the  CHKINACT2  tool  for  awhile,  you  may  prefer  this
       option to reduce the amount of printed output.

  **   Ignore system request jobs (IGNSYSRQS).

       Whether to  ignore inactive  system request  jobs.  The  default
       is  *YES.     In  general,  *YES  is   the  preferred  entry  as
       inactivity   in  the  active  job  will  cause  the  job  to  be
       disconnected  or ended.    See  the section  on  System  Request
       Jobs.

       *NO may  be specified for  special situations where you  want to
       end the job by specifying an action of *ENDIMM.

  **   Data  base option  (DBFOPTION) The  data base option  allows the
       writing of records to the  CHKINACT2S file in the library  named
       in the  DBFLIB option.   *NONE  is the  default meaning no  data
       base  records are written.   The other  options are the  same as
       the PRTOPT options.

       *ALL may be specified to cause  a record to be written for  each
       interactive  job  found   and  any  batch  jobs  in   the  named
       subsystems.

       *ACTION  may  be specified  to  write a  record  for those  jobs
       where an action will be performed.

       *ENDDSC  (End  or Disconnected)  may be  specified to  list only
       those jobs where an action other than *IGNORE occurred.

  **   Data base file library  (DBFLIB).  The default is  *NONE meaning
       no  data base output  will occur.   An  existing library  may be
       named  which will  contain the CHKINACT2S  file.   See the later
       section on 'Data Base Summary'.

  **   Test option (TSTOPTION).

       Whether you are testing the  tool.  The shipped default is  *YES
       to  assist you  when first  attempting to  understand the  tool.
       *YES prevents any action from being performed.

       *NO  may be specified when  you are ready to  go into production
       and want the actions performed.

  **   Disconnect option (DSCOPT).

       You cannot  disconnect a  pass-thru job  and some  TELNET  jobs.
       See the discussion for message ID CPF1358.

       For  jobs that  were  disconnected  (DSC status),  whether  they
       should be ended after a number of minutes.

       The shipped  default is 999  (*NOMAX) which means  they will not
       be  ended if the value  is used as the system  default.  If your
       requirement is that  a job in  a disconnected status should  not
       exist for  more than 2  hours, enter 120.   This option  is also
       available  for  an  individual  entry  with  WRKINACT2  where  a
       specific value  may  be  entered  instead of  using  the  system
       default.

       See also the section on 'Ending disconnected jobs'.

WRKINACT2 command to maintain the CHKINA2P file of exceptions
-------------------------------------------------------------

The file  of exceptions  allows you  to specify  different actions  and
timeout values  for certain users, all users in  a subsystem, etc.  You
may enter up  to 6000 records.   Any  change takes affect  at the  next
wakeup time.

As a user authorized to the CHKINA2P file in QGPL, enter:

             WRKINACT2

This displays a  subfile of any entries  that have been made.   Options
exist to add, change, display, etc.

  **   The  'Seq' field  allows a  4 digit  entry which  determines the
       sequence  in which  the exceptions will  be checked.   The first
       entry that matches a  subsystem, device, and user will  be used.
       When creating  a new entry,  it is generally advisable  to leave
       gaps  in the sequence such as 0010,  0020 to allow later entries
       to be added between the gaps.

  **   The 'Subsystem' field  allows you to  name a specific  subsystem
       or to specify *ALL.

  **   The 'Device' field  allows you to enter a  specific device name,
       a  generic  name,  or  *ALL.    When  PC  Emulation is  used,  a
       specific name may be assigned  to a device during  configuration
       or the system will assign a name such as QPADEVnnnn.

  **   The 'User'  field allows you  to enter a  specific user name,  a
       generic name, or *ALL.

  **   The 'Min'  field is the number of minutes  of inactivity that is
       allowed  before an action  is taken.  The  value must be between
       5 and 9999 minutes.

  **   The 'Action' field is the type of action to be taken.

       *ENDCTL  will   cause   an  end   to   the  job   using   ENDJOB
       OPTION(*CNTRLD).

       *ENDIMM   will  cause   an   end  to   the   job  using   ENDJOB
       OPTION(*IMMED).

       *DSCJOB  will cause  the DSCJOB  (Disconnect Job) command  to be
       used.

       *IGNORE will  prevent  any  action.   *IGNORE  is  intended  for
       devices  that are  in a  secure area  or  you never  want to  be
       ended by inactivity.

       *PGM will  cause a program to be called.   See the later section
       on 'Invoking a program'.

       See the  sections  on Group  Jobs  and System  Request  jobs  to
       understand how ending  or disconnecting these types of  jobs are
       handled.

  **   Using  either the 2  or 5  Option allows  a review or  change of
       the  'End min  after DSC sts'  option (not shown  in the subfile
       display).   This  determines whether  the  jobs that  match  the
       entry  will be  ended  if  they are  in  the DSC  (disconnected)
       status.

       The  special entry 998 (the default  when entering a new record)
       means to use  the corresponding value  for the DSCOPT  parameter
       in the Application Value.

       The  special entry  999 (*NOMAX)  means  the job  will never  be
       ended automatically.  It will remain in the DSC status.

       If you  want to end a disconnected job  after 2 hours, enter 120
       (minutes).

       See also the section on 'Ending disconnected Jobs'.

Ending disconnected jobs
------------------------

Either as a  system default  or by  a specific  entry using  WRKINACT2,
you may specify a job  be disconnected if it has had no  activity for a
number of minutes.

An  additional option allows  that once a  job is disconnected,  it may
be ended after a number of minutes.

The  CHKINACT2 tool default  is set in  the CHKINACT2 Application Value
in TAASECURE  with  the 'End  min after  DSC  sts' (DSCOPT)  parameter.
The shipped value  is 999 (*NOMAX) meaning any  job in the disconnected
status  that specifies the  use of the  Application Value  would not be
ended.

WRKINACT2 supports an  option that  may be specified  on an  individual
entry (use the 2 or 5 option) to change or display.

Special values exist:

  **   999 means  the job will  not be  ended if it  goes into  the DSC
       (disconnected) status.

  **   998  means the job uses  the Application Value  to determine the
       action.   When you  add  a record  with  WRKINACT2, 998  is  the
       default.

Note  that  if  a  job  is  disconnected,  a  message  appears  on  the
workstation  signon  prompt  stating  that  the job  was  disconnected.
These  jobs appear on WRKACTJOB.   If the job  is subsequently ended by
use CHKINACT2  because it has  been disconnected  past the time  limit,
the message is  not changed at the workstation.  If  the user signs on,
the  normal process  occurs and  not what  occurs if  the job  had been
disconnected.   When  a job  is  ended, it  will  no longer  appear  on
WRKACTJOB.

Invoking a program
------------------

An  option when  entering an  entry with  the WRKINACT2  command is  to
specify  an ACTION  of '*PGM'.   This means  a user written  program is
called when a timeout occurs for a specific entry.

You may  have  some entries  handled  by  actions such  as  *ENDCTL  or
*DSCJOB and one or more specified as *PGM.

The  '*PGM' value  may  also be  specified  for the  keyword  DFTACTION
using   EDTAPPVAL  APPVAL(TAASECURE/CHKINACT2).     This   would  allow
special handling if no entry is found when a timeout occurs.

The  user  program  must be  named  'USRINAC2'  and must  exist  on the
library list  of the  job  submitted by  SBMINACT2.   The program  must
accept  a  single  parameter  as  defined by  the  TAAJOEJT  externally
described  data structure.   The data structure  includes the qualified
job name that had a timeout.

The following describes  the basic  code for  different program  types.
The code may be copied into a program by first using:

             CPYTAA   TAAARCMBR(CHKINACT2)

This  will  place   the  source  for  the   documentation  into  member
CHKINACT2  of  file  QATTINFO in  TAATOOL.    To  copy the  appropriate
source, use the  'browse' function of  your source editor  to open  the
CHKINACT2 member.   Then  scan for  INVUSRPGM which  will position  the
source to the approximate proper position to allow copying.


                  RPG III
                  -------

     I* External DS for Action = *PGM
     IACTPGM    E DSTAAJOEJT
     .
     .
     C           *ENTRY    PLIST                           Parm list
     C                     PARM           ACTPGM           Ext DS
     C* Use any of the fields defined in TAAJOEJT


                  RPG LE
                  ------

     I* External DS for Action = *PGM
     D ACTPGM        E DS                  EXTNAME(TAAJOEJT)
     .
     .
     C     *ENTRY        PLIST
     C                   PARM                    ACTPGM
     C* Use any of the fields defined in TAAJOEJT

                  CL
                  --

             PGM        PARM(&FMT)
             DCLF       FILE(TAAJOEJT)
             DCL        &FMT *CHAR LEN(104)
             CHGVAR     &CPSEQ %SST(&FMT 1 4)
             CHGVAR     &CPSBS %SST(&FMT 5 10)
             CHGVAR     &CPJOB %SST(&FMT 15 10)
             CHGVAR     &CPUSER %SST(&FMT 25 10)
             CHGVAR     &CPJOBN %SST(&FMT 35 6)
             CHGVAR     &CPMIN %SST(&FMT 41 4)
              .

The  USRINAC2  program  can   perform  any  function  such  as  sending
messages, printing, ending the job, etc.

The  CHKINACT2 listing will describe the  Action column as '*PGM'.  You
may create a  unique listing of your  own.  Do  not attempt to use  the
open  CHKINACT2  spooled file  or  to  write  records to  the  optional
CHKINACTS file.

CHKINACT2 Data Area for Batch Jobs
----------------------------------

Normally the CHKINACT2 tool only checks for interactive jobs.

However,  the CHKINACT2  data  area in  TAASECURE may  be used  to name
subsystems  which  should   be  checked   for  batch  jobs   (including
pre-start  jobs) that  have no  activity for  a  period of  time.   Any
change takes affect at the next wakeup time.

If  a subsystem is  named such as  QBASE and contains  both interactive
and batch  jobs,  the interactive  jobs  are handled  with  the  normal
support and the batch jobs are considered separately.

As an *ALLOBJ user enter:

            EDTCONARR   DTAARA(TAASECURE/CHKINACT2)

You may enter up to  45 subsystem names that will be  checked for batch
jobs that you  want to end if they have no  activity.  'No activity' is
defined  as no CPU time used.   Use WRKINACT2 to specify the exceptions
for these subsystems or  use the default values set in  the Application
Value.  You cannot use *DSCJOB as an action for a batch job.

If a specified subsystem is not active, no error occurs.

A  typical display  to request  that  subsystems BATCH1  and BATCH2  be
checked would be:

********************************************************************
    Edit Constant Array - Check Inactive 2 Batch Sbs

 Type new/changed information, press Enter.
   To add an entry, type value.
   To remove an entry, space over the value.
   To change positions of an entry, type new sequence number.


  Sequence   Sbs name     Len = 10
    010      BATCH1_____________
    020      BATCH2_____________
    030      ___________________
    040      ___________________
    050      ___________________
               Object name


  F12=Cancel     Enter=Update or refresh (if any changes occur)

********************************************************************

Dynamic changes
---------------

Any of the three methods of changing options can be done dynamically:

      - CHKINACT2  Application Value
      - WRKINACT2  Exception file maintenance
      - CHKINACT2  Data Area

while  the batch  job  CHKINACT2 is  running and  will take  affect the
next time the batch job wakes up.

The  heading  information  in  the  batch  job  listing  describes  the
information when  the batch  job starts for  the Application  Value and
Data Area.

If  you are  making a  change to the  test option  (such as  setting it
from *YES to *NO), you should use ENDINACT2 to end the job first.

Otherwise, the summary  information may  be a  combination of  results.
For  example,  the  action totals  testing  to  production  will  be  a
combination of both what would have happened and what did happen.

Data Base Summary
-----------------

The  DBFOPTION and DBFLIB  options in  the CHKINACT2  Application Value
in  TAASECURE  will allow  you to  capture  information about  the jobs
that are considered  or have actions  taken on them.   You may  specify
to capture  all jobs,  only those  where an action  was taken,  or only
those  jobs which were  ended or  disconnected.  See  the discussion of
the options in the section on 'Application Value CHKINACT2'.

The CHKINACT2S  file may  be used  for general  query  purposes.   Note
that output to  the file is buffered by  an RPG program and  all of the
records may not appear until the job completes.

The  file will  be  created (if  it does  not exist)  by  SBMINACT2 and
owned by the owner of the job.   If the file exists, records are  added
to the file based on the DBFOPTION value.

The MTNINACT2 command  may be used  to clear out old  un-needed records
in  the file.   The user  of the  command must have  all rights  to the
file.   The number of  days to retain is specified  on the command such
as:

             MTNINACT2    RTNDAYS(2)

Any  records that  were  converted  prior  to  two days  ago  would  be
deleted.

Deletion  occurs by copying  the CHKINACT2S  data where  the conversion
day  is prior to the  RTNDAYS value.   The data is  then copied back to
the file  in your named  library replacing  the existing  data and  the
CHKINACT2S file in TAAWORK is deleted.

An  error will  occur  if the  CHKINACT2S file  already  exists in  the
TAAWORK  library.  If  you see this  error message it  could be because
the MTNINACT2 command was interrupted.

       If the  file  does not  have  the correct  records,  you  should
       delete the file and use MTNINACT2 again.

       If the file  has the correct records,  use CPYF to copy  back to
       the    CHKINACT2S   file   in    your   library    and   specify
       MBROPT(*REPLACE).  Then delete the file in TAAWORK.

Comparison with CHKINACT tool
-----------------------------

The  CHKINACT tool  relies upon  the system  support to send  a message
when a  device  has  not had  activity  based  on the  setting  of  the
QINACTITV system  value.  A message  is sent to  the QINACTMSGQ message
queue.

This  makes  it difficult  to allow  for  different timeout  values for
different situations.

CHKINACT2 uses a different technique  where the number of  transactions
and  CPU time  are  captured  for each  job  and  compared to  previous
values.   This requires  more overhead  to check, but  provides greater
flexibility.

CHKINACT2  also  supports  an  entry  by  subsystem  to  simplify   the
handling  of all  jobs  in  the same  subsystem.    An option  is  also
provided to  handle batch jobs in named subsystems  in the same manner.

Testing hint
------------

You  should  keep the  Application Value  TSTOPTION  value set  to *YES
until  you are  reasonably  satisfied  that you  have  the  Application
Value  options and the  WRKINACT2 entries  set the  way you  want them.
This  will allow  you to  see the  action that  would be  taken without
disrupting any work.

Group Jobs
----------

Group jobs have the  same device and user,  but different job  numbers.
Group  jobs  that are  not  active  appear  with  a status  of  GRP  on
WRKACTJOB (F14 is required to list them).

All group  jobs for the same device and user  are considered as one job
by CHKINACT2.    The activity  for  each group  job  is added  for  one
total.   If no activity has  been found at  the timeout, the  action is
performed on the active group job.

  **   Using  *ENDCTL or *ENDIMM  will cause all  jobs in the  group to
       end as ADLINTJOBS(*ALL) is specified on ENDJOB.

       If  *ENDCTL is  specified, the active  group job  is ended after
       the ENDJOB DLYTIM  (default of 30  seconds) occurs.  The  system
       will switch  to the  next group  job and it  will be  ended when
       the  30   second  delay  time  occurs  on  ENDJOB  (assuming  no
       activity).   This process  continues until  all  group jobs  are
       ended and  then the  signon prompt is  displayed.   Depending on
       how many group jobs exist, this may take awhile.

       If  *ENDIMM is  specified, all  group  jobs end  immediately and
       the signon prompt will appear.

  **   If DSCJOB  is specified,  the signon  prompt appears.    Signing
       back onto the  same user profile  will allow the  inactive group
       jobs to be accessed again where they left off.

System Request Jobs
-------------------

System request  jobs will have  the same device  name and a  unique job
number.    They may  have a  different user  name.   The  active system
request job is  known as the 'primary  job'.  System request  jobs that
are not active  are known as 'secondary jobs' and  appear with a status
of SRQ on WRKACTJOB.  (F14 is required to list them).

  **   Use with ENDJOB.

       A  secondary job  will  not be  ended by  ENDJOB OPTION(*CNTRLD)
       until  the  job  goes  active  (becomes  the  primary).    Using
       OPTION(*IMMED) will end this type of job.

       The Application  Value supports an  option IGNSYSRQS  which will
       allow  you to  ignore  any secondary  jobs.   This  is generally
       preferred as  an  ENDJOB action  against  the primary  job  will
       cause both  the primary and  secondary to  end (ADLINTJOBS(*ALL)
       is  specified  on  ENDJOB).   If  OPTION(*CNTRLD)  is used,  the
       primary  job is ended  after the DLYTIM of  30 seconds occurs on
       ENDJOB.   The  secondary  job will  become  active and  then  be
       ended by  the system  after the 30  second time delay  occurs on
       ENDJOB  (assuming no activity occurs).   Note that this will end
       the secondary  job regardless  of whether  the user  of the  job
       differs from the primary job.

  **   Use with DSCJOB.

       DSCJOB  may  not  be  used  on  a  secondary  job.    Using  the
       IGNSYSRQS  option   will  prevent  an  error  occurring  on  the
       CHKINACT2 job listing.

       When DSCJOB  is used  for  the primary  job, the  signon  prompt
       appears regardless of  whether there is  a secondary job.   Both
       the  primary job  specified  for  DSCJOB and  the  secondary job
       will still exist, but signon is required for each.

Security considerations
-----------------------

The  CRTINACT2 command  requires a  user with  *ALLOBJ authority.   The
command's AUT  parameter determines  what the  *PUBLIC user  can do  to
the  CHKINA2P and CHKINA2L  files.   *USE is  the default  allowing the
use  of WRKINACT2 for  printing and to  read the file  during the batch
job submitted by SBMINACT2.   Individual authorizations may be made  to
the file.

WRKINACT2  requires  the  user  to  have  *CHANGE  authority  for  file
maintenance.  *USE authority is required to use the print option.

Only  a  user   with  *ALLOBJ  authority  can  use  EDTAPPVAL  for  the
Application Value CHKINACT2 in TAASECURE.

Only a  user with  *ALLOBJ authority  can use  EDTCONARR  for the  data
area CHKINACT2 in TAASECURE.

SBMINACT2 requires  a user  with *JOBCTL  authority and *USE  authority
to the CHKINA2P file.

The  TAAJOEJC23  CL  program  adopts  *ALLOBJ  authority to  allow  the
retrieval  of  the values  from  the Application  Value  CHKINACT2 from
TAASECURE.    Since only  the  values  are  returned,  the  program  is
considered safe.

The  TAAJOEJC24  CL  program  adopts  *ALLOBJ authority  to  allow  the
RTVOBJD  command  to  retrieve  the  text  description  of any  profile
during the use of WRKINACT2.   Since only RTVOBJD is used for the  text
description, the program is considered safe.

The  TAAJOEJC25  CL  program  adopts *ALLOBJ  authority  to  allow  the
RTVDTAARA  command to  retrieve the CHKINACT2  data area  in TAASECURE.
Since only RTVDTAARA is used, the program is considered safe.

ENDINACT2 escape messages you can monitor for
----------------------------------------------

      TAA9893    The CHKINACT2 job is not active

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

RTVINACT2 escape messages you can monitor for
----------------------------------------------

      TAA9894    The entry was not found

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

CRTINACT2 Command parameters                          *CMD
----------------------------

   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 must be QATTDDS.

   AUT           The authorization  to the created files.   *USE is the
                 default  to allow the *PUBLIC  user to read the files.
                 *CHANGE  or *EXCLUDE  may  be  specified.   *USE  will
                 allow a user to print the information.

DLTINACT2 Command parameters                          *CMD
----------------------------

No parameters  exist.  The files  created by CRTINACT2 will  be deleted
from QGPL.

WRKINACT2 Command parameters                          *CMD
----------------------------

   OUTPUT        How to output the results.

                 *  is the  default to allow  the data  to be displayed
                 and   maintained   if    the   command   is    entered
                 interactively.

                 *PRINT may  be entered to print  a listing of  the the
                 records.

SBMINACT2 Command parameters                          *CMD
----------------------------

No parameters exist.

RTVINACT2 Command parameters                          *CMD
----------------------------

   SEQ           The sequence number to retrieve for.

   SBS           The  subsystem  of the  entry.   This  is  an optional
                 return variable that if  used must specified as  *CHAR
                 LEN(10).

   DEV           The device or job  of the entry.  This  is an optional
                 return variable  that if used must  specified as *CHAR
                 LEN(10).

   USER          The  user of  the entry.   This is  an optional return
                 variable  that  if   used  must  specified  as   *CHAR
                 LEN(10).

   MINUTES       The number  of minutes  before the action  occurs from
                 the  entry.  This is an  optional return variable that
                 if used must specified as *DEC LEN(3 0).

   ACTION        The action of the entry.   This is an optional  return
                 variable  that   if  used  must  specified   as  *CHAR
                 LEN(7).

   DSCTIM        The  time in minutes  after a  job has been  placed in
                 the DSC (disconnected) status  that it will be  ended.
                 A value  of 9999  means *NOMAX  (the job  will not  be
                 ended).   This is an optional return  variable that if
                 used must specified as *DEC LEN(4 0).

ENDINACT2 Command parameters                          *CMD
----------------------------

No parameters exist.

MTNINACT2 Command parameters                          *CMD
----------------------------

   RTNDAYS       The  number of days  to retain data  in the CHKINACT2S
                 file.  The  library for the  file is specified in  the
                 Application Value CHKINACT2 in TAASECURE.

                 If  2  is entered,  all  data  in  the file  that  was
                 converted before 2 days ago will be removed.

                 The value must be between 0 and 99999.

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

None.

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

The following TAA Tools must be on your system:

     ADDDAT          Add date
     ADDTIM          Add time
     ADJVAR          Adjust variable
     CHKALLOBJ       Check *ALLOBJ special authority
     CHKJOBENDS      Check job end status
     CHKJOBCTL       Check *JOBCTL special authority
     CHKNAM          Check name
     CPYTAADDS       Copy TAA DDS
     CVTDAT          Convert date
     CVTWRKACT       Convert work active
     DUPTAADBF       Duplicate TAA data base file
     EDTVAR          Edit variable
     FILEFDBCK       File feedback
     HLRMVMSG        HLL Remove message
     RTVDAT          Retrieve date
     RTVJOBSTS       Retrieve job status
     RTVSYSVAL3      Retrieve system value 3
     RTVTIMSTM       Retrieve time stamp
     SNDCOMPMSG      Send completion message
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message
     SNDSTSMSG       Send status message
     UPDPFILE        Update PFILE keyword

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

None, the tool is ready to use.

File structure
--------------

       QGPL library    Source      Description
       ------------    ------      -----------

       CHKINA2P        TAAJOEJP    Master file of users, devices
       CHKINA2L        TAAJOEJL    Logical over CHKINA2P

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

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

   CRTINACT2     *CMD                   TAAJOEJ       QATTCMD
   DLTINACT2     *CMD                   TAAJOEJ2      QATTCMD
   WRKINACT2     *CMD                   TAAJOEJ3      QATTCMD
   SBMINACT2     *CMD                   TAAJOEJ4      QATTCMD
   ENDINACT2     *CMD                   TAAJOEJ5      QATTCMD
   RTVINACT2     *CMD                   TAAJOEJ6      QATTCMD
   MTNINACT2     *CMD                   TAAJOEJ7      QATTCMD
   TAAJOEJC      *PGM       CLP         TAAJOEJC      QATTCL
   TAAJOEJC2     *PGM       CLP         TAAJOEJC2     QATTCL
   TAAJOEJC3     *PGM       CLP         TAAJOEJC3     QATTCL
   TAAJOEJC4     *PGM       CLP         TAAJOEJC4     QATTCL
   TAAJOEJC5     *PGM       CLP         TAAJOEJC5     QATTCL
   TAAJOEJC6     *PGM       CLP         TAAJOEJC6     QATTCL
   TAAJOEJC7     *PGM       CLP         TAAJOEJC7     QATTCL
   TAAJOEJC14    *PGM       CLP         TAAJOEJC14    QATTCL
   TAAJOEJC21    *PGM       CLP         TAAJOEJC21    QATTCL
   TAAJOEJC22    *PGM       CLP         TAAJOEJC22    QATTCL
   TAAJOEJC23    *PGM       CLP         TAAJOEJC23    QATTCL
   TAAJOEJC24    *PGM       CLP         TAAJOEJC24    QATTCL
   TAAJOEJC25    *PGM       CLP         TAAJOEJC25    QATTCL
   TAAJOEJR3     *PGM       RPG         TAAJOEJR3     QATTRPG
   TAAJOEJR6     *PGM       RPG         TAAJOEJR6     QATTRPG
   TAAJOEJR14    *PGM       RPG         TAAJOEJR14    QATTRPG
   TAAJOEJR15    *PGM       RPG         TAAJOEJR15    QATTRPG
   TAAJOEJD      *FILE      DSPF        TAAJOEJD      QATTDDS
   TAAJOEJP      *FILE      PF          TAAJOEJP      QATTDDS
   TAAJOEJQ      *FILE      PF          TAAJOEJQ      QATTDDS
   TAAJOEJL      *FILE      LF          TAAJOEJL      QATTDDS
   TAAJOEJS      *FILE      PF          TAAJOEJS      QATTDDS
   TAAJOEJT      *FILE      PF          TAAJOEJT      QATTDDS

The  CHKINACT2 Application Value (*USRSPC)  and CHKINACT2 *DTAARA exist
in TAASECURE.

The TAAJOEJT file  is used  as an externally  described data  structure
of use in the Action = *PGM function.

Structure
---------

CRTINACT2   Cmd
   TAAJOEJC   CL pgm

DLTINACT2   Cmd
   TAAJOEJC2  CL pgm

WRKINACT2   Cmd
   TAAJOEJC3  CL pgm
     TAAJOEJR3  RPG pgm
       TAAJOEJD  Display file
       TAAJOEJC24   CL Pgm to access user profile text

SBMINACT2   Cmd
   TAAJOEJC4   CL pgm - Submits
                          TAAJOEJC14 CL Pgm
                            TAAJOEJR14 RPG Pgm - Builds work file
                            TAAJOEJR15 RPG Pgm - Checks master file
                              TAAJOEJC21  CL Pgm - Gets compltn time
                              TAAJOEJC22  CL Pgm - Does END/DSCJOB
                              TAAJOEJC23  CL Pgm - Accesses App Value
                              TAAJOEJC25  CL Pgm - Accesses Data Area

ENDINACT2   Cmd
   TAAJOEJC5  CL pgm

RTVINACT2   Cmd
   TAAJOEJC6  CL pgm
     TAAJOEJR6  RPG pgm

MTNINACT2   Cmd
   TAAJOEJC7  CL pgm
					

Added to TAA Productivity tools March 26, 2007


Home Page Up to Top