TAA Tools
CHKACTUSR2      CHECK ACTIVE USER 2                    TAAJOFP

The Check  Active User 2  command is designed  for the situation  where
you periodically want  to check for a list of users  to see if they are
active.   On the first use or when  RESET(*YES) is specified, a file is
built in QTEMP of  the active users.  The  file is then checked to  see
if  the specified  user is  active  and if  not, an  escape message  is
issued.    On  subsequent  uses  with  RESET(*NO),  only  the  file  is
checked.

Note that this tool  is designed for checking  whether the user has  at
least one active  job (typically interactive).  A tool  such as WRKJOB2
can provide  a display of all jobs active for  a user and CVTWRKACT can
create a similar outfile.

You must have *JOBCTL special authority to use CHKACTUSR2.

A typical command would be:

               CHKACTUSR2 USER(xxx)

The default is to  check for I  = Interactive jobs  only.  The  command
checks if  the WRKACTP file  exists in  QTEMP and if  not, it uses  the
TAA  tool  CVTWRKACT to  create  the  outfile of  active  jobs and  the
WRKACTL  logical  file with  a  key on  user name.    The file  is then
checked to see if the user exists.

If the file  already exists, the  code only checks  to see if  the user
exists.

If  the  user is  active,  the  command  completes normally  without  a
message.    The  data area  CHKACTUSR2  in QTEMP  is  updated  with the
information about the first  job found that is  active.  The data  area
is defined as *CHAR 100 with a layout of:

       1 - 10  Job name
      11 - 20  User
      21 - 26  Job number
      31 - 31  Job type such as I = Interactive

The data area will be blank if the user is not active.

When you  want to refresh  the list (cause  another use  of CVTWRKACT),
you must specify RESET(*YES).

Note  that the command only  checks for the  status of the  user at the
time CVTWRKACT was  run.   It is  possible for  the user  to signon  or
signoff after  the use  of CVTWRKACT  and before your  code checks  the
individual user.

CHKACTUSR2 escape messages you can monitor for
----------------------------------------------

      TAA9891    The user is not active
      TAA9892    The user profile does not exist

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

CHKACTUSR2 Command parameters                         *CMD
-----------------------------

   USER          The user  to be checked to determine  if he is active.
                 If   the  user   is  active,   the  command  completes
                 normally with no  message.   The data area  CHKACTUSR2
                 in   QTEMP   is   updated   with  the   specific   job
                 information   found.     See   the   layout  described
                 previously.

                 If the  user is  not  active, TAA9891  is sent  as  an
                 escape message.

                 If the  user does  not exist,  TAA9892 is  sent as  an
                 escape message.

   JOBTYPE       The  type of user job  to be checked.   The default is
                 'I' for interactive.

                 The  other  supported  values  are  *=All  job  types,
                 A=Autostart,  B=Batch  (includes  BCH,  BCI,  PJ,  and
                 other   batch  types),   M=Monitor,   R=Spool  reader,
                 S=System job, X=Start CPF, and W=Spool writer.

                 Note   that  this  parameter  is  ignored  unless  the
                 WRKACTP file  does not exist  in QTEMP or  RESET(*YES)
                 is  specified.   The work  file that  is  generated by
                 CVTWRKACT is based on the JOBTYP.

   RESET         Whether  to reset the file created  by CVTWRKACT.  *NO
                 is the default  to use  the existing file  information
                 in QTEMP.   If the  file does not  exist, the  file is
                 created as if RESET(*YES) was specified.

                 *YES  should  be  specified  when  you have  completed
                 processing the list  and want  to check  again at  the
                 first user on your list.

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

Note that  the command only checks  for the status  of the user  at the
time  CVTWRKACT was  run.  It  is possible  for the  user to  signon or
signoff  after the  use of  CVTWRKACT and  before your code  checks the
individual user.

You must have *JOBCTL special authority to use CHKACTUSR2.

The  data area  contains  the  information  for the  first  active  job
found.

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

The following TAA Tools must be on your system:

     CHKJOBCTL       Check *JOBCTL special authority
     CLRDTAARA       Clear data area
     CRTLFSRC        Create LF source
     CVTWRKACT       Convert WRKACT to an outfile
     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   CHKACTUSR2    *CMD                   TAAJOFP       QATTCMD
   TAAJOFPC      *PGM       CLP         TAAJOFPC      QATTCL
   TAAJOFPR      *PGM       RPG         TAAJOFPR      QATTRPG
					

Added to TAA Productivity tools July 15, 2011


Home Page Up to Top