TAA Tools
RTVPRTA         RETRIEVE PRINTER ATTRIBUTES            TAAPRTG

The Retrieve Printer  Attributes command retrieves the attributes  of a
printer and  what it is  printing.  Because many  attributes exist, two
commands  (RTVPRTA  and RTVPRTA2)  are  used.   Choose  one or  both to
return the attributes you  need.  The QGYRPRTA  API is used to  extract
the information.

A typical series of commands would be:

             DCL           &DEVSTS *CHAR LEN(10)
              .
             RTVPRTA       DEV(xxx) DEVSTS(&DEVSTS)
             IF            (&DEVSTS *EQ '*STOPPED') DO

RTVPRTA  escape messages you can monitor for
--------------------------------------------

      CPF9814    Device not found

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

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

   DEV           The  printer device name  to retrieve  attributes for.

   WTRSTR        A  return  value that  will  contain *YES  or  *NO for
                 whether a  writer  has been  started to  the  printer.
                 This is  an optional  return value  that if  used must
                 be specified as *CHAR LEN(4).

   WTRSTS        A  return value  that will contain  the status  of the
                 writer.   The  possible return  values  are  *STARTED,
                 *ENDED,  *ONJOBQ, *HELD,  or  *MSGWAIT.   This  is  an
                 optional return  value that if used  must be specified
                 as *CHAR LEN(10).

   DEVSTS        A  return value  that will  contain the  status of the
                 device.    The  possible  return  values  include  all
                 valid  types for  any device  type some  of  which are
                 not  applicable  to  a  printer  device.   The  values
                 include  *VRYOFF,  *AS36DISABL,  *VRYOFFPND,  *ACTRDR,
                 *ACTWTR,  *HELD, *PWROFF,  *RCYPND, *RCYCNL,  *SYSRQS,
                 *FAILED,     *FAILEDRDR,     *FAILEDWTR,    *DIAGMODE,
                 *DAMAGED,  *LOCKED,  and   *UNKNOWN.     This  is   an
                 optional return value  that if used must  be specified
                 as *CHAR LEN(10).

   OVRALLSTS     A  return value that  will contain the  overall status
                 of  the logical  printer.  The  possible return values
                 are  *UNAVAIL, *PWROFF/NA  (powered  off  or  not  yet
                 available),   *STOPPED,  *MSGWAIT,   *HELD,  *STOPPND,
                 *HOLDPND,  *WAITPRT, *WAITSTR,  *PRINTING, *WAITOUTPT,
                 *CNNPND,   *PWROFF,    *UNUSABLE,   *INSERVICE,    and
                 *UNKNOWN.   This is an  optional return value  that if
                 used must be specified as *CHAR LEN(10).

   TEXT          A   return   value   that   will   contain  the   text
                 description of  the  printer.   This  is  an  optional
                 return value that  if used must be specified  as *CHAR
                 LEN(50).

   STRUSR        A  return value that  will contain  the user  name who
                 started  the  writer  to  the  device.    This  is  an
                 optional return value  that if used must  be specified
                 as *CHAR LEN(10).

   WRITINGSTS    A return  value that  will contain the  writing status
                 of  the  writer.    The  possible  return  values  are
                 *WRITING,  *NOTWRITING,  and  *FILESEP  (writing  file
                 separator).   This is  an optional  return value  that
                 if used must be specified as *CHAR LEN(10).

   WAITMSGSTS    A  return value  that will contain  *YES/*NO depending
                 on whether the writer is  waiting for a message to  be
                 answered.   This is an  optional return value  that if
                 used must be specified as *CHAR LEN(10).

   HLDSTS        A return  value that will contain a  *YES or *NO value
                 for  whether the  writer has  been held.   This  is an
                 optional return value that  if used must be  specified
                 as *CHAR LEN(4).

   ENDPNDSTS     A return  value that  will contain a  value describing
                 if/how  the  writer is  ending.   The  possible return
                 values are *NOENDWTR,  *IMMED, *CNTRLD, and  *PAGEEND.
                 This is  an optional  return value  that if  used must
                 be specified as *CHAR LEN(10).

   HOLDPNDSTS    A  return value that describing  if/how the the writer
                 is  being  held.    The  possible  return  values  are
                 *NOHLDWTR, *IMMED,  *CNTRLD,  and *PAGEEND.   This  is
                 an  optional  return   value  that  if  used  must  be
                 specified as *CHAR LEN(10).

   BTWFILSTS     A  return value that will contain  a *YES or *NO value
                 for  whether  the writer  is  between  writing  files.
                 This  is an optional  return value  that if  used must
                 be specified as *CHAR LEN(4).

   BTWCPYSTS     A  return value that will contain  a *YES or *NO value
                 for whether the  writer is  between writing copies  of
                 a file.   This  is an  optional return  value that  if
                 used must be specified as *CHAR LEN(4).

   WAITDTASTS    A return  value that will describe  whether the writer
                 is waiting  for  more data  to  print.   The  possible
                 return values are  *WAITING, and *NOWAIT.  This  is an
                 optional return  value that if used  must be specified
                 as *CHAR LEN(10).

   WAITDEVSTS    A  return value that will  describe whether the device
                 is  waiting.     The   possible   return  values   are
                 *WAITING,  and *NOWAIT.   This  is an  optional return
                 value  that   if  used  must  be  specified  as  *CHAR
                 LEN(10).

   ONJOBQSTS     A return value that will  contain a *YES or *NO  value
                 for whether  the writer job is  on a job queue.   This
                 is  an  optional return  value  that if  used  must be
                 specified as *CHAR LEN(10).

   WTRJOB        A return value that will  contain the name of the  job
                 assigned  to the  writer  job.   This  is an  optional
                 return value  that if used must be  specified as *CHAR
                 LEN(10).

   WTRUSR        A  return  value that  will  contain the  name  of the
                 user  assigned  to  the  writer  job.     This  is  an
                 optional return  value that if used  must be specified
                 as *CHAR LEN(10).

   WTRJOBNBR     A  return  value  that  will  contain  the job  number
                 assigned to  the  writer job.    This is  an  optional
                 return value that  if used must be  specified as *CHAR
                 LEN(6).

   PRTDEVTYP     A return  value that will contain  the type of device.
                 This is an  optional return  value that  if used  must
                 be specified as *CHAR LEN(10).

   FILESEP       A return  value that will  contain the number  of file
                 separators  to  be   printed.    The  possible  return
                 values  are *FILE or a number  of separators.  This is
                 an  optional  return  value  that  if  used   must  be
                 specified as *CHAR LEN(5).

   DRAWER        A  return  value that  will  contain  the drawer  from
                 which  the  separators  will  be  fed.    The possible
                 return values are  *FILE, *DEV,  or the drawer  number
                 (1,2,3).   This is  an optional  return value  that if
                 used must be specified as *CHAR LEN(5).

   ALIGN         A  return value that will  contain the forms alignment
                 message  option.    The  possible  return  values  are
                 *FILE  or *WTR.    This is  an  optional return  value
                 that if used must be specified as *CHAR LEN(10).

   OUTQ          A  return value  that  will contain  the  output queue
                 name  being used by  the writer.   This is an optional
                 return value that if  used must be specified  as *CHAR
                 LEN(10).

   OUTQLIB       A  return value  that  will contain  the output  queue
                 library  name being  used by the  writer.   This is an
                 optional return value that  if used must be  specified
                 as *CHAR LEN(10).

   OUTQSTS       A return  value that  will contain  the status of  the
                 output queue  being used by the  writer.  The possible
                 return values  are *HELD  or *RELEASED.   This  is  an
                 optional return value  that if used must  be specified
                 as *CHAR LEN(10).

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

   DEV           The  printer device name  to retrieve  attributes for.

   NETWRKDIR     A   return  value   that  will   contain  the  network
                 directory  publishing status.    The  possible  return
                 values  are  *PUBLISH  or  *NOTPUBLSH.    This  is  an
                 optional  return value that if  used must be specified
                 as *CHAR LEN(10).

   FORMTYPE      A return value that will  contain the form type  being
                 used  by  the writer.    This  is an  optional  return
                 value  that   if  used  must  be  specified  as  *CHAR
                 LEN(10).

   MSGOPTION     A return  value that  will contain  the option  to  be
                 used when  sending  messages to  the writer's  message
                 queue.   The possible return values  are *MSG, *NOMSG,
                 *INFOMSG,  and *INQMSG.   This  is an  optional return
                 value  that  if  used  must  be   specified  as  *CHAR
                 LEN(10).

   AUTOENDWTR    A return value  that will contain a value  for when to
                 end   the   writer   if/how   it   is   to  be   ended
                 automatically.    The   possible  return  values   are
                 *NORDYF,  *FILEEND,  or  *NO.   This  is  an  optional
                 return value  that if used must  be specified as *CHAR
                 LEN(10).

   ALWDIRPRT     A return  value that  will  contain a  *YES/*NO  value
                 for whether  direct  printing (as  opposed to  spooled
                 printing)  is allowed.    This is  an  optional return
                 value   that  if  used  must  be  specified  as  *CHAR
                 LEN(10).

   MSGQ          A return  value that  will contain  the message  queue
                 name  assigned to  the writer.   This  is  an optional
                 return  value that if used must  be specified as *CHAR
                 LEN(10).

   MSGQLIB       A return  value that  will contain  the message  queue
                 library  name assigned  to  the writer.    This is  an
                 optional  return value that if  used must be specified
                 as *CHAR LEN(10).

   CHANGES       A  return  value  that  will  contain  the  value  for
                 if/when  pending  changes will  take  effect  for  the
                 writer.    The  possible  return values  are  *NORDYF,
                 *FILEEND,  or *NOPNDCHG.   This is  an optional return
                 value  that  if  used  must  be   specified  as  *CHAR
                 LEN(10).

   NXTOUTQ       A  return value  that  will contain  the  name of  the
                 next  output queue  that will  be used by  the writer.
                 If there  is  no  'next output  queue',  *NOPNDCHG  is
                 returned.   This is an  optional return value  that if
                 used must be specified as *CHAR LEN(10).

   NXTOUTQLIB    A  return  value that  will  contain the  name  of the
                 next output queue  library that  will be  used by  the
                 writer.    If   there  is  no  'next   output  queue',
                 *NOPNDCHG  is returned.   This  is an  optional return
                 value   that  if  used  must  be  specified  as  *CHAR
                 LEN(10).

   NXTFORMTYP    A return  value that will  contain the  value for  the
                 next form type  to be used by the writer.   This is an
                 optional  return value that if  used must be specified
                 as *CHAR LEN(10).

   NXTMSGOPT     A return  value  that will  contain  the value  to  be
                 used next  for the  handling of  messages sent  to the
                 writer's  message queue.   The possible  return values
                 are *MSG,  *NOMSG,  *INFOMSG, *INQMSG,  and  *NOPNDCHG
                 (there  is no  next  option).    This is  an  optional
                 return value  that if used must be  specified as *CHAR
                 LEN(10).

   NXTFILESEP    A  return  value that  will  contain the  value  to be
                 used next  for the  number  of file  separators.   The
                 possible  return values  are  *FILE, *NOPNDCHG  (there
                 is  no next  separator), or  the number  of separators
                 to be used  next.   This is an  optional return  value
                 that if used must be specified as *CHAR LEN(10).

   NXTDRAWER     A  return value  that  will contain  the  value to  be
                 used  next for the  drawer from  which file separators
                 are fed.    The  possible  return  values  are  *FILE,
                 *DEVD, *NOPNDCHG  (there is  no next  drawer), or  the
                 next  drawer  number (1,2,3).    This  is an  optional
                 return  value that if used  must be specified as *CHAR
                 LEN(10).

   SPLF          A return  value  that will  contain  the name  of  the
                 spooled  file  being printed.    This  is an  optional
                 return  value that if used must  be specified as *CHAR
                 LEN(10).

   JOB           A return value that will  contain the name of the  job
                 which owns  the spooled file  being printed.   This is
                 an  optional   return  value  that  if  used  must  be
                 specified as *CHAR LEN(10).

   USER          A return  value  that will  contain  the name  of  the
                 user of  the  job which  owns the  spooled file  being
                 printed.   This is  an optional  return value  that if
                 used must be specified as *CHAR LEN(10).

   JOBNBR        A  return value that will contain  the name of the job
                 number of the  job which owns  the spooled file  being
                 printed.   This is  an optional  return value  that if
                 used must be specified as *CHAR LEN(10).

   SPLFNBR       A  return  value that  will contain  the  spooled file
                 number of the  spooled file  being printed.   This  is
                 an  optional  return  value  that   if  used  must  be
                 specified as *CHAR LEN(10).

   SPLFDATE      A  return   value  that  will  contain  the  date  the
                 spooled  file  being   printed  was  opened   (cyymmdd
                 format).   This is  an optional  return value that  if
                 used must be specified as *CHAR LEN(7).

   SPLFTIME      A  return  value   that  will  contain  the  time  the
                 spooled   file  being   printed  was   opened  (hhmmss
                 format).   This is an  optional return  value that  if
                 used must be specified as *CHAR LEN(6).

   CURPAGE       A  return value that  will contain  the number  of the
                 current  page of the  spooled being printed.   This is
                 an  optional  return  value  that  if  used   must  be
                 specified as *DEC LEN(9 0).

   TOTPAGE       A return value  that will contain the  total number of
                 pages  of  the  spooled being  printed.    This is  an
                 optional return value that  if used must be  specified
                 as *DEC LEN(9 0).

   RMNCOPIES     A  return  value  that  will  contain  the  number  of
                 remaining  copies of the  spooled file  being printed.
                 This  is an  optional return  value that  if used must
                 be specified as *DEC LEN(3 0).

   TOTCOPIES     A return value that  will contain the total  number of
                 copies  of the spooled  file being  printed.   This is
                 an  optional   return  value  that  if  used  must  be
                 specified as *DEC LEN(3 0).

   AFP           A return  value that  will  contain a  *YES/*NO  value
                 for  whether   the  device   supports  AFP   (Advanced
                 Function  Printing).    This  is  an  optional  return
                 value  that  if  used  must  be  specified  as   *CHAR
                 LEN(10).

   MSGKEY        A  return value  that  will  contain the  message  key
                 assigned  to the  message  that is  awaiting  a reply.
                 If  no message exists, blanks  will be returned.  This
                 is an  optional  return value  that  if used  must  be
                 specified as *CHAR LEN(4).

   JOBSYS        A  return value  that  will contain  the  name of  the
                 system  of  the  job  that  created  the  spooled file
                 being printed.    This  is an  optional  return  value
                 that if used must be specified as *CHAR LEN(8).

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

None.

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

The following TAA Tools must be on your system:

     EDTVAR          Edit variable
     RSNLSTMSG       Resend last 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
   ------        ----    ---------      ----------    ----------

   RTVPRTA       *CMD                   TAAPRTG       QATTCMD
   RTVPRTA2      *CMD                   TAAPRTG2      QATTCMD
   TAAPRTGC      *PGM       CLP         TAAPRTGC      QATTCL
   TAAPRTGC2     *PGM       CLP         TAAPRTGC2     QATTCL

Structure
---------

RTVPRTA     Cmd
   TAAPRTGC   CL pgm

RTVPRTA2    Cmd
   TAAPRTGC2  CL pgm
					

Added to TAA Productivity tools March 31, 2004


Home Page Up to Top