TAA Tools
RTVWTRSTS       RETRIEVE WRITER STATUS                 TAASPMP

The Retrieve Writer  Status command retrieves  the current status  of a
writer.   Various attributes of  the writer and of  the current spooled
file  being  written  may  be  returned.    The  QSPRWTRI  API  is used
internally.

A typical command would be:

             DCL         &OUTQ *CHAR LEN(10)
             DCL         &SPLF *CHAR LEN(10)
             DCL         &SPLFPAGES *DEC LEN(9 0)
              .
             RTVWTRSTS   DEV(xxx) OUTQ(&OUTQ) SPLF(&SPLF) +
                           SPLFPAGES(&SPLFPAGES)

A printer device  must be named.   Various information can be  returned
such as  the output queue  that is assigned  and the spooled  file that
is being written.

RTVWTRSTS escape messages you can monitor for
---------------------------------------------

      TAA9893    Writer does not appear to be active

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

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

   DEV           The  device name of  the printer for  which the writer
                 is assigned to.

   STRUSR        The name of  the user  who started the  writer.   This
                 is an  optional return variable  that if used  must be
                 specified as *CHAR LEN(10).

   WTRSTS        Whether  the writer is  writing.   The values returned
                 are Y=the  Writer  is  writing; N=the  Writer  is  not
                 writing; and  S=Separators  are being  written.   This
                 is an  optional return variable  that if used  must be
                 specified as *CHAR LEN(1).

   WAITMSG       Whether  the writer is  waiting on a message.   A Y or
                 N  will be  returned.    This is  an  optional  return
                 variable  that  if used  must  be  specified as  *CHAR
                 LEN(1).

   HLDSTS        Whether  the writer  is in a  held status.   A  Y or N
                 will  be  returned.    This  is  an   optional  return
                 variable  that if  used  must  be specified  as  *CHAR
                 LEN(1).

   ENDPNDSTS     Whether the  writer is in an 'end'  pending status.  A
                 Y or N will be returned.   This is an optional  return
                 variable  that if  used  must  be specified  as  *CHAR
                 LEN(1).

   HLDPNDSTS     Whether  the writer  is in  a 'held'  pending status'.
                 The   values  returned  will   be  N=Not  being  held;
                 I=Immed.  Writer  will be held  after the buffers  are
                 empty; C=Controlled.   Writer  will be held  after the
                 current  copy is output; and P=Page  end.  Writer will
                 be held at the end of  the page.  This is an  optional
                 return  variable that  if  used must  be specified  as
                 *CHAR LEN(1).

   BTWFILSTS     Whether  the writer is between  files.  A Y  or N will
                 be returned.   This  is  an optional  return  variable
                 that if used must be specified as *CHAR LEN(1).

   BTWCPYSTS     Whether the writer is  between copies.  A Y  or N will
                 be  returned.   This  is an  optional  return variable
                 that if used must be specified as *CHAR LEN(1).

   WAITDTASTS    Whether  the  writer  is waiting  for  additional data
                 for a spooled  file that is being  written.  A Y  or N
                 will  be  returned.     This  is  an  optional  return
                 variable  that  if  used must  be  specified  as *CHAR
                 LEN(1).

   WAITDEVSTS    Whether the writer is waiting  for the device that  is
                 in use by a  job that is directly printing.  A  Y or N
                 will  be   returned.    This  is  an  optional  return
                 variable that  if  used  must be  specified  as  *CHAR
                 LEN(1).

   WTRJOB        The job name of  the Writer job.  This  is an optional
                 return  variable that  if  used must  be  specified as
                 *CHAR LEN(10).

   WTRUSR        The  user  name  of  the  Writer  job.    This  is  an
                 optional  return  variable   that  if  used  must   be
                 specified as *CHAR LEN(10).

   WTRJOBNBR     The  job  number  of  the  Writer job.    This  is  an
                 optional   return  variable  that   if  used  must  be
                 specified as *CHAR LEN(6).

   DEVTYP        The type  of device  assigned.   This  is an  optional
                 return  variable that  if  used must  be specified  as
                 *CHAR LEN(10).

   FORMTYPE      The  form  type specified  on  the  STRPRTWTR command.
                 The values  returned will  be *ALL=Print  all  spooled
                 files; *FORMS=Print spooled  files with the  same form
                 type;  or *STD= Print  all spooled  files with  a form
                 type  of *STD.   This  is an  optional return variable
                 that if used must be specified as *CHAR LEN(10).

   FILESEP       The number of file  separators to be printed.   Either
                 *FILE or  the number  of separators will  be returned.
                 This  is  an  optional return  variable  that  if used
                 must be specified as *CHAR LEN(5).

   ALIGN         The time  at which  the forms  alignment message  will
                 be sent.   *WTR,  *FILE, or  *FIRST will be  returned.
                 This  is  an optional  return  variable  that if  used
                 must be specified as *CHAR LEN(10).

   OUTQ          The output queue assigned to  the writer.  This is  an
                 optional  return  variable   that  if  used   must  be
                 specified as *CHAR LEN(10).

   OUTQL         The  library  of  the  output  queue assigned  to  the
                 writer.   This is an  optional return variable that if
                 used must be specified as *CHAR LEN(10).

   OUTQSTS       The status  of  the  assigned output  queue.    Either
                 H=Held; or  R=Released will be  returned.  This  is an
                 optional   return  variable  that   if  used  must  be
                 specified as *CHAR LEN(1).

   AUTOEND       The 'auto end'  option as  specified on the  STRPRTWTR
                 command.   The values returned  will be *NORDYF  if no
                 files  are  ready  to be  printed;  *FILEEND  when the
                 current spooled  file is  printed; or  *NO the  writer
                 will  not end  automatically.    This is  an  optional
                 return  variable that  if  used must  be  specified as
                 *CHAR LEN(10).

   MSGQ          The  message queue  assigned to  the writer.   This is
                 an  optional return  variable  that  if used  must  be
                 specified as *CHAR LEN(10).

   MSGQL         The  library  of the  message  queue  assigned to  the
                 writer.   This is an optional  return variable that if
                 used must be specified as *CHAR LEN(10).

   NXTOUTQ       The next output  queue to be  assigned to the  writer.
                 This  is an  optional  return  variable that  if  used
                 must be specified as *CHAR LEN(10).

   NXTOUTQL      The library  of the next output  queue assigned to the
                 writer.  This is an  optional return variable that  if
                 used must be specified as *CHAR LEN(10).

   NXTFORMTYP    The next  form type  to be  used by the  writer.   The
                 values  returned  will  be  blank=No change  has  been
                 made;   *ALL=Print  all  spooled  files;  *FORMS=Print
                 spooled files with the  same form type; or  *STD=Print
                 all spooled files  with a form type of  *STD.  This is
                 an  optional  return  variable that  if  used  must be
                 specified as *CHAR LEN(10).

   SPLF          The name  of  the  spooled  file  which  is  currently
                 being written.   This  is an optional  return variable
                 that if used must be specified as *CHAR LEN(10).

   SPLFNBR       The  number of  the spooled file  within the  job that
                 is currently  being  written.   This  is  an  optional
                 return  variable that  if used  must  be specified  as
                 *CHAR LEN(4).

                 If  the  number  of  the  spooled file  being  written
                 exceeds  9999, 0s are returned.   Use SPLFNB2 instead.

   SPLFNB2       The number  of the  spooled file within  the job  that
                 is  currently  being written.    This  is an  optional
                 return  variable  that if  used must  be  specified as
                 *CHAR LEN(6).

   SPLFJOB       The job name  of the spooled  file which is  currently
                 being written.   This is  an optional  return variable
                 that if used must be specified as *CHAR LEN(10).

   SPLFUSR       The  user name of the  job for which  the spooled file
                 is currently  being  written.   This  is  an  optional
                 return  variable that  if used  must  be specified  as
                 *CHAR LEN(10).

   SPLFJOBNBR    The job  number of the job for  which the spooled file
                 is  currently  being  written.   This  is  an optional
                 return variable  that  if used  must be  specified  as
                 *CHAR LEN(6).

   SPLFPAGES     The  total  number  of   pages  in  the  spooled  file
                 currently  being written.  This  is an optional return
                 variable that  if  used  must  be  specified  as  *DEC
                 LEN(9 0).

   CURPAGE       The current page  in the spooled file  currently being
                 written.    Some  page  printing  devices  buffer  the
                 pages and  only an  estimate of  the current  page  is
                 provided.   This is an  optional return  variable that
                 if used must be specified as *DEC LEN(9 0).

   TOTCPY        The  total  number  of  copies  for the  spooled  file
                 currently  being written.  This  is an optional return
                 variable  that  if used  must  be  specified  as  *DEC
                 LEN(3 0).

   RMNGCPY       The  number of  remaining copies  of the  spooled file
                 currently  being written.  This  is an optional return
                 variable that  if  used  must  be  specified  as  *DEC
                 LEN(3 0).

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

Because the  command returns variables, RTVWTRSTS  may only be  used in
a CL program.

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

The following TAA Tools must be on your system:

     RTVDEVPRT       Retrieve device printer
     SNDESCMSG       Send escape message

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

None, the tool is ready to use.

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

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

   RTVWTRSTS     *CMD                   TAASPMP       QATTCMD
   TAASPMPC      *PGM       CLP         TAASPMPC      QATTCL
					

Added to TAA Productivity tools February 28, 2000


Home Page Up to Top