RTVSPLFA      RETRIEVE SPOOLED FILE ATTRIBUTES              TAASPLF

 The RTVSPLFA  command  allows you  to extract  one  or more  parameters
 from an  existing spooled file  into a CL  program.  Because  more than
 40   parameters  exist,   the  companion  command   RTVSPLFA2  is  also
 included.    These commands  can  be  used  for  various  functions  in
 working with spooled files.

 A  typical  use of  the  command  is to  extract  the  ALIGN option  to
 determine if alignment may be necessary.

         DCL         &ALIGN *CHAR LEN(4)
         .
         .
         RTVSPLFA    SPLF(xxxxxx) ALIGN(&ALIGN)
         IF          (&ALIGN *EQ '*YES') DO .....

 The  command parameters  may  be prompted  for with  the command.   The
 value in the  parenthesis for each parameter  describes the length  and
 type  of field  to  be specified  in  your CL  program  to receive  the
 parameter.

 Uses the API QUSRSPLA to access the information.

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

    SPLF          The spooled file name to be retrieved.

    JOB           The  qualified job  name.   An  * is  the  default and
                  means the current job.

    SPLNBR        The spooled  file  number.    *ONLY  is  the  default.
                  *LAST  may be  specified or  a  specific spooled  file
                  number.

    SYSNAM        The  serial  number of  the  system  to retrieve  for.
                  *ANY  is the  default.   A specific  serial number may
                  be entered.

    RTNSPLNBR     The number  of the  spooled file being  returned.   If
                  SPLNBR  is a  special value,  the number  returned may
                  be  helpful.    If  specified,  the  variable must  be
                  declared as *CHAR LEN(6).

    FORMTYPE      An optional  return  variable that  will  contain  the
                  form  type  used for  the  file.   If  specified,  the
                  variable must be declared as *CHAR LEN(10).

    OUTPTY        An  optional  return variable  that  will  contain the
                  output priority.  If  specified, the variable must  be
                  declared as *CHAR LEN(1).

    CPYLEFT       An  optional return  variable  that will  contain  the
                  number  of copies  left to  be output.   If  no output
                  has  occurred,  the  value  will be  the  same  as the
                  COPIES parameter.   If  specified,  the variable  must
                  be declared as *CHAR LEN(3).

    COPIES        An  optional return  variable  that  will contain  the
                  number  of   copies  specified.    If  specified,  the
                  variable must be declared as *CHAR LEN(3).

    MAXRCDS       An optional  return  variable that  will  contain  the
                  maximum number  of records  valid for  the file.   For
                  printer  output, the number of  records written cannot
                  be determined.   For the  number of  pages that  exist
                  in  the   file,  see   the  TOTPAG   parameter.     If
                  specified,  the  variable must  be  declared as  *CHAR
                  LEN(10).

    FILESEP       An  optional  return  variable that  will  contain the
                  number  of   file  separators  for   the  file.     If
                  specified,  the variable  must  be  declared as  *CHAR
                  LEN(1).

    SCHEDULE      An  optional  return variable  that  will  contain how
                  the  file  is  scheduled   for  output.    The   value
                  returned will  be *IMMED,  *FILEEND, or  *JOBEND.   If
                  specified,  the  variable must  be  declared  as *CHAR
                  LEN(10).

    HOLD          An  optional   return  variable   that  will   contain
                  whether the file  is held before  it is written.   The
                  value  comes  from  the  CRT/CHG/OVRPRTF command.    A
                  *YES  or *NO  value will  be returned.   If specified,
                  the variable must be declared as *CHAR LEN(4).

    SAVE          An  optional   return  variable   that  will   contain
                  whether the  file is to  be saved after it  is output.
                  A  *YES or *NO value will  be returned.  If specified,
                  the variable must be declared as *CHAR LEN(4).

    DEVTYPE       An optional  return  variable that  will  contain  the
                  device  type of  the file.   For  printer output,  the
                  value  returned will  be PRINTER.   If  specified, the
                  variable must be declared as *CHAR LEN(10).

    PRTTYPE       An optional  return  variable that  will  contain  the
                  printer type  of  the file.   The  value returned  for
                  printer  output will  be *SCS,  *IPDS,  *AFPDS, *LINE,
                  or  a truncated  version of  *AFPDSLINE or *USERASCII.
                  The  RTVSPLFA2 command  returns  a 10  byte  parameter
                  PRTTYPE2.     If  specified,  the   variable  must  be
                  declared as *CHAR LEN(5).

    DEVFILE       An  optional  return variable  that  will  contain the
                  name of  the  device  file  used.   For  example,  the
                  return  value  would  be QPRINT  if  the  program  had
                  specified  that  file.    If  specified, the  variable
                  must be declared as *CHAR LEN(10).

    DEVFILEL      An optional  return  variable that  will  contain  the
                  library where the  device file exists.   If specified,
                  the variable must be declared as *CHAR LEN(10).

    USRDTA        An  optional  return variable  that  will contain  the
                  user  data specified for the  file.  If specified, the
                  variable must be declared as *CHAR LEN(10).

    ACGCDE        An optional  return  variable  that will  contain  the
                  accounting   code  specified   for  the   file.     If
                  specified,  the  variable must  be  declared  as *CHAR
                  LEN(15).

    OPNPGM        An optional  return  variable that  will  contain  the
                  name  of  the  program  that  opened  the  file.    If
                  specified,  the  variable must  be  declared  as *CHAR
                  LEN(10).

    OPNPGML       An optional  return  variable that  will  contain  the
                  library  where  the program  exists  that  opened  the
                  file.   If  specified, the  variable must  be declared
                  as *CHAR LEN(10).

    OPNDAT        An  optional  return  variable that  will  contain the
                  date the  file was  opened.  The  date is  8 bytes  in
                  the  form  yymmdd  with   separator  characters.    If
                  specified,  the  variable must  be  declared  as *CHAR
                  LEN(8).

    OPNTIM        An optional  return  variable that  will  contain  the
                  time the  file was  opened.   The time  is 8 bytes  in
                  the  form   hhmmss  with  separator  characters.    If
                  specified, the  variable  must be  declared  as  *CHAR
                  LEN(8).

    PAGWTN        An  optional return  variable  that will  contain  the
                  page  number  being  written.    If  the file  is  not
                  currently  being written  by a writer,  the value will
                  be 0.   If specified,  the variable  must be  declared
                  as *CHAR LEN(10).

    TOTPAG        An  optional return  variable  that  will contain  the
                  total  number  of  pages.    For  printer  files,  the
                  number of lines  written is  not a value  that can  be
                  returned.   If the  file is  not closed,  this is  the
                  number   of  pages   written  to   that  point.     If
                  specified, the  variable  must be  declared  as  *CHAR
                  LEN(10).

    RCDLEN        An  optional return  variable  that will  contain  the
                  record length  of the file.  If  an externally printer
                  file  is  used, the  value  returned is  *RCDF (record
                  format).     If  specified,   the  variable  must   be
                  declared as *CHAR LEN(5).

    PAGLEN        An  optional return  variable  that  will contain  the
                  page  length of the file.   If specified, the variable
                  must be declared as *CHAR LEN(3).

    PAGWTH        An optional  return  variable that  will  contain  the
                  page width  of the file.   If specified,  the variable
                  must be declared as *CHAR LEN(3).

    LPI           An  optional  return variable  that  will  contain the
                  lines per  inch  of  the  file.    If  specified,  the
                  variable must be declared as *CHAR LEN(1).

                  See the  RTVSPLFA2  command for  the LPIDEC  parameter
                  to  retrieve the number  of decimal positions  and the
                  LPI2 parameter to return 2 character LPI values.

                  If  the LPI is  greater than 9,  the value returned is
                  '0'.

                  If the LPI value is 7.5, the value returned is 6.

    CPI           An optional  return  variable  that will  contain  the
                  characters per  inch of the  file.  If  specified, the
                  variable  must be declared  as *CHAR LEN(2).   See the
                  RTVSPLFA2  command   for  the   CPIDEC  parameter   to
                  retrieve the number of decimal positions.

    OVRFLW        An  optional return  variable  that  will contain  the
                  overflow  line   of  the  file.    If  specified,  the
                  variable must be declared as *CHAR LEN(3).

    FOLD          An  optional   return  variable   that  will   contain
                  whether the  output  lines are  to be  folded if  they
                  exceed  the printer  width.   A  *YES or  *NO  will be
                  returned.    A  *YES  value does  not  imply  that the
                  print  lines have  been  folded.   If  specified,  the
                  variable must be declared as *CHAR LEN(4).

    CTLCHAR       An  optional return  variable  that  will contain  the
                  control  character type  used for  the file.   A value
                  of *NONE,  or *FCFC  (first character  forms  control)
                  will be  returned.   If specified,  the variable  must
                  be declared as *CHAR LEN(5).

    RPLUNPRT      An   optional  return   variable  that   will  contain
                  whether  a  character  has  been  defined  to  replace
                  unprintable characters.   A value of *YES or  *NO will
                  be  returned.   If  specified,  the  variable must  be
                  declared as *CHAR LEN(4).

    ALIGN         An   optional  return   variable  that   will  contain
                  whether the file should  be aligned.  A value  of *YES
                  or *NO  will be returned.  If  specified, the variable
                  must be declared as *CHAR LEN(4).

    PRTQLTY       An  optional  return variable  that  will  contain the
                  print quality of  the file.   The value returned  will
                  be  *STD, *DRAFT,  *NLQ,  *DEVD,  or *FASTDRAFT.    If
                  specified,  the  variable must  be  declared  as *CHAR
                  LEN(6).

    FORMFEED      An optional  return  variable that  will  contain  the
                  form feed  of the  file.   If specified, the  variable
                  must be declared as *CHAR LEN(8).

    DRAWER        An  optional  return variable  that  will contain  the
                  Source  Drawer  used  for the  file  when  *AUTOCUT is
                  specified for Form  Feed.  If specified,  the variable
                  must be declared as *CHAR LEN(7).

    FONT          An  optional return  variable  that  will contain  the
                  Font  specified  for  the  file.    If specified,  the
                  variable must be declared as *CHAR LEN(5).

    PAGRTT        An optional  return  variable that  will  contain  the
                  page rotation used  for the file.   The value returned
                  will  be *AUTO, *DEVD, *COR,  0, 90, 180, or  270.  If
                  specified, the  variable  must be  declared  as  *CHAR
                  LEN(5).

    JUSTIFY       An  optional return  variable  that will  contain  the
                  Justify  value  (right justify  the  output) used  for
                  the  file.    A  value  of  0,  50,  or  100  will  be
                  returned.    If   specified,  the  variable  must   be
                  declared as *CHAR LEN(3).

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

    SPLF          The spooled file name to be retrieved.

    JOB           The  qualified job  name.   An  * is  the default  and
                  means the current job.

    SPLNBR        The  spooled  file  number.    *ONLY  is  the default.
                  *LAST may  be  specified or  a specific  spooled  file
                  number.

    RTNSPLNBR     The number  of the  spooled file  being returned.   If
                  SPLNBR  is a  special value,  the number  returned may
                  be helpful.    If  specified,  the  variable  must  be
                  declared as *CHAR LEN(6).

    OUTQ          The  output queue  containing the  spooled  file.   If
                  specified,  the  variable must  be  declared as  *CHAR
                  LEN(10).

    OUTQL         The   output  queue  library  containing  the  spooled
                  file.   If specified,  the variable  must be  declared
                  as *CHAR LEN(10).

    CRTUSER       The  user that  originally created  the spooled  file.
                  If  specified, the variable must  be declared as *CHAR
                  LEN(10).

    CRTSYS        The  system  that  the  spooled  file  was  originally
                  created  on.    If specified,  the  variable  must  be
                  declared as *CHAR LEN(8).

    STATUS        The  status of the  spooled file.   The value returned
                  will  one  of  *CLOSED,  *DEFERRED,  *SENDING,  *HELD,
                  *MESSAGE,   *OPEN,   *PRINTER,   *READY,   SAVED,   or
                  *WRITING.    Also  see  STATUS4.   If  specified,  the
                  variable must be declared as *CHAR LEN(10).

    STATUS4       The  status  of the  spooled file  in 4  characters as
                  displayed  on   WRKSPLF  and  WRKOUTQ.     The   value
                  returned  will be  one of  CLS, DFR,  SND,  HLD, MSGW,
                  OPN,  PRT, RDY,  SAV, or  WTR.  Also  see STATUS.   If
                  specified, the  variable  must be  declared  as  *CHAR
                  LEN(4).

    DBCSDATA      A  *YES/*NO   value  for  whether  the   spooled  file
                  contains  DBCS data.  If  specified, the variable must
                  be declared as *CHAR LEN(4).

    PRTTEXT       The print  text assigned  to print  at the  bottom  of
                  the page.   The  value may  be blank.   If  specified,
                  the variable must be declared as *CHAR LEN(30).

    RPLCHAR       The  character  to  be  used  to  replace  unprintable
                  characters.    If  specified,  the  variable  must  be
                  declared as *CHAR LEN(1).

    MULTIUP       Whether multiple-up  pages  should be  printed on  the
                  same page.   The  value returned is  1,2,3, or 4.   If
                  specified,  the  variable must  be  declared  as *CHAR
                  LEN(1).

    LPIDEC        An optional  return  variable that  will  contain  the
                  number of  decimal positions  for the  lines per  inch
                  of  the  file.   If  specified, the  variable  must be
                  declared as *CHAR LEN(1).

                  See the  RTVSPLFA command  for  the LPI  parameter  to
                  retrieve the  whole  number if  9 or  less.   Use  the
                  RTVSPLFA2  command  LPI2  parameter  to  retrieve  the
                  whole numbers if greater than 9.

    LPI2          An  optional  return  variable that  will  contain the
                  number of lines per  inch of the file.   If specified,
                  the variable must be declared as *CHAR LEN(2).

                  This  value will contain  whole numbers  such as  '6 '
                  or  '12'.  The  RTVSPLFA command LPI  parameter may be
                  used to  retrieve  the whole  number  if  it is  9  or
                  less.   The number  of decimal  positions is  returned
                  in the LPIDEC variable of RTVSPLFA2.

    CPIDEC        An  optional  return variable  that  will  contain the
                  number of  decimal positions  for the  characters  per
                  inch of  the file.   If  specified, the variable  must
                  be  declared  as  *CHAR  LEN(1).    See  the  RTVSPLFA
                  command  for the CPI parameter  to retrieve the number
                  of whole numbers.

    USRDFNTXT     An  optional return  variable  that will  contain  the
                  information  from the  interactive  user profile  when
                  the  spooled  file  was created.    If  specified, the
                  variable must be declared as *CHAR LEN(100).

    USRDFNDTA     An optional  return  variable that  will  contain  the
                  information  from  the  USRDFNDTA  parameter  used  on
                  CRTPRTF or  OVRPRTF.  If specified,  the variable must
                  be declared as *CHAR LEN(250).

                  See also USRDFNDTA2  which allows the  full 255  bytes
                  allowed to be returned.

    USRDFNDTA2    An  optional return  variable  that will  contain  the
                  information  from  the  USRDFNDTA  parameter  used  on
                  CRTPRTF  or OVRPRTF.  If  specified, the variable must
                  be declared as *CHAR LEN(255).

    PRTTYPE2      An optional  return  variable  that will  contain  the
                  printer  type of  the file.   The  value  returned for
                  printer  output will  be  *SCS, *IPDS,  *AFPDS, *LINE,
                  *AFPDSLINE,  or  *USERASCII.    The  RTVSPLFA  command
                  returns  a 5  byte parameter  PRTTYPE which  truncates
                  some of  the values.  If  specified, the variable must
                  be declared as *CHAR LEN(10).

    STRPAGE       An optional  return  variable that  will  contain  the
                  starting page  number for the  file.  If  CHGSPLFA has
                  been  used   to  change  the  starting   page  of  the
                  PAGERANGE  parameter, the value will  be returned.  If
                  neither the start or  end page has been  specified for
                  the  PAGERANGE parameter, a  0 is  returned.   If only
                  the  end page  value was  specified, a 1  is returned.
                  If *ENDPAGE  was  specified, a  -1  is returned.    If
                  STRPAGE is  specified, the  variable must  be declared
                  as *DEC LEN(10 0).

    ENDPAGE       An  optional  return variable  that  will  contain the
                  ending page  number for  the file.   If  CHGSPLFA  has
                  been used to  change the ending page of  the PAGERANGE
                  parameter, the  value will be returned.   If the value
                  has  not  been  changed,  a  0  is  returned  (see the
                  TOTPAG parameter on RTVSPLFA  for the total number  of
                  pages).   If ENDPAGE  is specified, the  variable must
                  be declared as *DEC LEN(10 0).

    FILEOPEN      An  optional return variable that  will contain a *YES
                  or *NO  for  whether  the  file is  still  open.    If
                  FILEOPEN is  specified, the variable must  be declared
                  as *CHAR LEN(4).

    EXPDATE       An  optional  return  variable  that  will contain  an
                  expiration  date  (CYMD  format)  for  when  the  file
                  expires.   If  no expiration  date has  been set,  the
                  value  will be blank.   If  EXPDATE is  specified, the
                  variable must be declared as *CHAR LEN(7).

    LSTUSE        An  optional  return  variable that  will  contain the
                  last  date  (CYMD  format)  for  when   the  file  was
                  displayed,   copied,  printed,   sent,  or   when  the
                  attributes  were  changed.   The initial  date  is the
                  same as the date  the file was opened.   If LSTUSE  is
                  specified,  the variable  must  be  declared as  *CHAR
                  LEN(7).

    FIDELITY      An  optional  return variable  that  will  contain the
                  Fidelity attribute of the  spooled file.  *CONTENT  or
                  *ABSOLUTE  will   be   returned.     If  FIDELITY   is
                  specified,  the  variable must  be  declared as  *CHAR
                  LEN(10).

    REDUCE        An  optional  return  variable that  will  contain the
                  Reduce  attribute  of  the  spooled  file  when  doing
                  multiple  up  printing.     *TEXT  or  *NONE  will  be
                  returned.   If REDUCE is  specified, the variable must
                  be declared as *CHAR LEN(5).

    DUPLEX        An optional  return  variable that  will  contain  the
                  Duplex  attribute   (print  on  both  sides)   of  the
                  spooled   file  when   doing  multiple   up  printing.
                  *FORMDF, *NO, YES,  or *TUMBLE will  be returned.   If
                  DUPLEX is  specified,  the variable  must be  declared
                  as *CHAR LEN(10).

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

 None.

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

 None.

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

 None, the tool is ready to use.

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

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

    RTVSPLFA      *CMD                      TAASPLF        QATTCMD
    RTVSPLFA2     *CMD                      TAASPLF2       QATTCMD
    TAASPLFC      *PGM          CLP         TAASPLFC       QATTCL
    TAASPLFC2     *PGM          CLP         TAASPLFC2      QATTCL

Added to TAA Productivity Tools April 1, 1995


Home Page

Powered by AS/400Powered by AS/400 Last modified on July 15, 2010 © 1995, 2010 - Jim Sloan, Inc.