TAA Tools
CHKSPLF         CHECK SPOOLED FILE                     TAASPMA

The Check Spooled  File command checks  for the existence of  a spooled
file and  optionally for whether  the spooled file  is still open.   If
the  job  exists, but  not  the spooled  file,  TAA9883 is  sent  as an
escape message.   If  the job does  not exist,  TAA9884 is  sent as  an
escape message.   If  the option to  check for an  open status  is used
and the  file is still open, TAA9885 is sent  as an escape message.  If
the spooled  file was  deleted  from the  job, CPF3309  is sent  as  an
escape message.

The command is useful  when a program needs to  check for the existence
or  status of  a spooled  file  before performing  an operation  on it.
For example,  if you  submit a  batch  job, you  may be  interested  in
knowing when a  spooled file has been  fully output (the file  has been
closed) by the batch job.

A typical command to check existence of a spooled file would be:

             CHKSPLF      SPLF(xxx)
             MONMSG       MSGID(TAA9883) EXEC(DO) /* No such SPLF */

                          /* Your processing */

             ENDDO        /* No such SPLF */

To check if a spooled file is open, you would specify:

             CHKSPLF      SPLF(xxx) CHKOPEN(*YES)
             MONMSG       MSGID(TAA9885) EXEC(DO) /* Still open */

                          /* Your processing */

             ENDDO        /* Still open */

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

   SPLF          The spooled  file name to be checked.   If the spooled
                 file  does  not exist,  TAA9883 is  sent as  an escape
                 message.

   JOB           The qualified  job  name.   An *  is  the default  and
                 means the  current job.   If the  job does  not exist,
                 TAA9884 is sent as an escape message.

   SPLNBR        The  spooled  file  number.    *ONLY  is the  default.
                 *LAST may  be specified  or  a specific  spooled  file
                 number in the range of 000001 - 999999.

   CHKOPEN       An  optional  parameter  to   check  for  whether  the
                 spooled  file is in an  *OPEN status.   The default is
                 *NO meaning that no checking occurs.

                 *YES may be  specified to  cause a  check against  the
                 current status  of the  spooled file.   If the  status
                 is *OPEN, TAA9895 is sent as an escape message.

                 There   are  some   exception  conditions   where  the
                 spooled  file will  not be in  a status  of *OPEN, but
                 will not  be closed  by a  program.   For example,  if
                 the  spooled  file  is SCHEDULE(*IMMED),  the  spooled
                 file  may have  a status  of *WRITING even  though the
                 program  is  still  writing  records  to  the  spooled
                 file.   Similarly, a  status of *MESSAGE  may indicate
                 the program has not closed the file.

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

See previous comments.

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

The following TAA Tools must be on your system:

     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   CHKSPLF       *CMD                   TAASPMA       QATTCMD
   TAASPMAC      *PGM       CLP         TAASPMAC      QATTCL
					

Added to TAA Productivity tools November 1, 1997


Home Page Up to Top