TAA Tools
CHKJOBSTS       CHECK JOB STATUS                       TAAJOFY

The Check Job Status  command provides a simple test to  determine if a
job exists  and what the status is (such  as *JOBQ, *ACTIVE, or *OUTQ).
A  job type  such as INT  or BCH may  also be specified.   An exception
message is optional if more than one job meets the criteria.

There is a  limit of  200 jobs that  may be checked  using the JOB  and
STATUS parameters.   Some form of selection is  recommended to make the
results meaningful.

A typical command would be:

             CHKJOBSTS  JOB(*ALL/*ALL/ABC) STATUS(*ACTIVE)

If  the job  ABC is active,  the command  would complete  normally.  If
there are multiple  ABC jobs  active, the command  would also  complete
normally.   If  no ABC  job  is active,  TAA9891  would be  sent as  an
escape message.

Another choice would be to add the MULTJOBESC message such as:

             CHKJOBSTS  JOB(*ALL/*ALL/ABC) STATUS(*ACTIVE)
                          MULTJOBESC(*YES)

If  multiple ABC jobs  are active, TAA9893  would be sent  as an escape
message.

Another choice would be to check if a user has an interactive job:

             CHKJOBSTS  JOB(*ALL/USER1/*ALL) JOBTYPE(INT)

Since a job type  of INT (interactive)  is specified, the  STATUS(*ALL)
default can  be used.   If there  is at least  one interactive job  for
the user,  the command will complete normally.   If the interactive job
has  a group job or  system request job, the job  will be considered to
have multiple jobs.  The command will complete normally.

If  duplicate  jobs  exist,  the  FNDJOB  command  can  assist  you  in
reviewing the jobs.

CHKJOBSTS escape messages you can monitor for
---------------------------------------------

      TAA9891    No job meets the search criteria
      TAA9893    Multiple jobs meet the search criteria
                   and MULTJOBESC(*YES) was specified

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

CHKJOBSTS Command parameters                          *CMD
----------------------------

   JOB           The qualified  name of the job.   A job name  value is
                 required.  The special value *ALL may be entered.

                 The user name defaults to *ALL.

                 The job number defaults to *ALL.

                 If  an interactive  job has  a group  job or  a system
                 request job,  the  job  will  be  considered  to  have
                 multiple jobs.

   STATUS        The status  to be checked for.   *ALL is  the default.
                 *JOBQ, *ACTIVE, or *OUTQ may also be specified.

   JOBTYPE       The job type to check for.  *ALL is the default.

                 One of the following may be entered:

                    ASJ = Autostart
                    BCH = Batch
                    BCI = Batch immediate
                    EVK = Started by a procedure start request
                    INT = Interactive
                    M36 = Advanced S/36 server job
                    MRT = Multiple requester terminal
                    PJ  = Prestart job
                    PDJ = Print driver job
                    RDR = Reader
                    SBS = Subsystem monitor
                    SYS = System
                    WTR = Writer

   CURUSER       The 'current  user' to select for if  a 'swap' of user
                 profiles has occurred.   For example,  you can  bypass
                 jobs with  the same  job name  and user  name that  do
                 not have the specified current user profile.

                 *ALL is  the default meaning any  current user profile
                 associated with the specified job.

                 A  specific user  profile name  may be  entered or the
                 special value  *USER  meaning  the user  name  of  the
                 current job.

   MULTJOBESC    A  *YES/*NO  value  for  whether  to  send  an  escape
                 message   if   multiple   jobs   satisfy  the   search
                 criteria.   *NO  is the  default meaning  if  multiple
                 jobs  satisfy the  search criteria,  the command  will
                 complete normally.

                 *YES  may be  specified to  cause the  TAA9893 message
                 to be  sent  as an  escape  message if  multiple  jobs
                 satisfy the search criteria.


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

There is  a limit  of 200 jobs  (after selection)  that may  be checked
using  the JOB  and STATUS  parameters.   If 200  or  more exist  to be
checked,  the command ends normally with  a completion message.  FNDJOB
may be used to find the jobs.

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

The following TAA Tools must be on your system:

     EDTVAR          Edit variable
     RTVJOBA2        Retrieve job attributes 2
     RTVJOBSTS       Retrieve job status
     SNDCOMPMSG      Send completion message
     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
   ------        ----    ---------      ----------    ----------

   CHKJOBSTS     *CMD                   TAAJOFY       QATTCMD
   TAAJOFYC      *PGM       CLP         TAAJOFYC      QATTCL
					

Added to TAA Productivity tools July 15, 2012


Home Page Up to Top