TAA Tools
DUPSPLF     DUPLICATE SPOOLED FILE              TAASPLD

The Duplicate Spooled File  command duplicates a spooled file  from one
output queue  to another.  The  command is useful when  two versions of
the same printed output are needed.

Two  commands are  provided.   The new form  of DUPSPLF  uses the spool
APIs.  The  new form of  the command should be  used in most  instances
as  it  avoids  the  restrictions  that were  caused  by  the  previous
function.    A  later discussion  will  describe the  old  form  of the
command which is named DUPSPLF2.

DUPSPLF may not be used when the  spooled file is still open.  You  may
use the RTVSPLFA2  FILEOPEN parameter to determine if  the spooled file
is still open.

To  duplicate the spooled  file QPRINT to  the file QPRINTX,  you would
specify:

    DUPSPLF    FILE(QPRINT) NEWSPLF(QPRINTX) OWNER(*USER)

You must have *USE authorization  to the TAADUPSPLF authorization  list
to use the DUPSPLF command.  Enter:

             EDTAUTL       AUTL(TAADUPSPLF)

and add users to allow the use of DUPSPLF.

The OWNER parameter  determines who the  owner of the new  spooled file
will be.   If OWNER(*SAME)  is specified, the  same owner is  used.  To
use  other  than  *SAME,  you  must  be  authorized  to  the  TAASPLDST
authorization list.   This is  the same authorization  list as used  by
the SPLDST tool.

If  you are  authorized to  the TAASPLDST  authorization list,  you may
specify:

  **   OWNER(*USER).   The  user of  the job becomes  the owner  of the
       new spooled file.

  **   OWNER(xxxxx).   The user  name specified  becomes  the owner  of
       the spooled  file and the  job QPRTJOB is  automatically created
       for the user.

You  can duplicate to  the same name  file to a  different output queue
such as:

    DUPSPLF    FILE(QPRINT) OUTQ(REMOTE)

You can duplicate the file and give it a different name such as:

    DUPSPLF    FILE(QPRINT) NEWSPLF(PAYROLL)

DUPSPLF escape messages you can monitor for
-------------------------------------------

      TAA9896    The spooled file is still open

DUPSPLF Command                                       *CMD
---------------

DUPSPLF uses  the  spool  APIs  to  duplicate  a  spooled  file  so  no
attributes are lost.

   FILE          The spooled file name to be duplicated.

   NEWSPLF       The name of the  new spooled file to be  created.  The
                 default  is *SPLF meaning  the same  name of  the file
                 being duplicated is used.

   JOB           The  qualified job  name of  the job  with the spooled
                 file.  The default is * meaning the current job.

   OUTQ          The qualified  output  queue of  where the  new  spool
                 file should  be duplicated to.   The default  is *FILE
                 which  means  to  use  the  same  output  queue.   The
                 library  defaults  to  *LIBL.     The  special   value
                 *PRTFILE also means  to use the same  output queue and
                 is  supported to  provide  compatibility with  the old
                 version of DUPSPLF.

   SPLNBR        The file number  of the spooled  file.  This  defaults
                 to  *ONLY.    *LAST  or  a   specific  number  can  be
                 specified.

   OWNER         The  owner of the  new spooled  file.  The  default is
                 *SAME  meaning  the  existing  spooled  file  owner is
                 also the owner of the new spooled file.

                 To specify  a  value other  than  *SAME, you  must  be
                 authorized  to   the  TAASPLDST   authorization  list.
                 This  is the  same authorization  list as used  by the
                 SPLDST tool.

                 If you are authorized  to the TAASPLDST  authorization
                 list, you may specify:

                 OWNER(*USER).   The the  user of  the job becomes  the
                 owner of the new spooled file.

                 OWNER(xxxxx).   The  user  name specified  becomes the
                 owner of  the  spooled file  and  the job  QPRTJOB  is
                 automatically created for the user.

   COPIES        The number of  copies to be  printed.  The  default is
                 *SAME.  Up to 255 may be specified.

   FOLD          Whether  to fold the  print lines  if the line  is too
                 long.    The default  is *SAME.   *YES  or *NO  may be
                 specified.

   ALIGN         Whether to  cause the  forms alignment  message.   The
                 default is *SAME.  *YES or *NO may be specified.

   FORMFEED      The  manner in  which forms  are fed  to  the printer.
                 The  default  is  *SAME.    The  values  *DEVD, *CONT,
                 *CUT, or *AUTOCUT may be specified.

   PRTQLTY       The print quality to be  used.  The default is  *SAME.
                 The values *DEVD,  *DRAFT, *NLQ, or *FASTDRAFT  may be
                 specified.

   FIDELITY      The  print  fidelity  to  be  used.   The  default  is
                 *SAME.   The  values  *CONTENT  or  *ABSOLUTE  may  be
                 specified.

   PAGRTT        The amount  of page  rotation required.   The  default
                 is  *SAME.  The  values *AUTO,  *DEVD, 0, 90,  180, or
                 270 may be specified.

   MULTIUP       The  number of logical  pages to be  printed per side.
                 The  default  is  *SAME.    A  value  of  1-4  may  be
                 specified.

   JUSTIFY       Whether  to  use  a hardware  justification  function.
                 The  default is *SAME.   A value of 0,  50, 100 may be
                 specified.

   DUPLEX        Whether to  print on  both  sides of  the page.    The
                 default is  *SAME.  A value  of *NO, *YES,  or *TUMBLE
                 may be specified.

   UOM           The  unit of measure  to use.   The default  is *SAME.
                 A value of *INCH, or *CM may be specified.

   FORMTYPE      The form  type  to be  printed  on.   The  default  is
                 *SAME.   A character value  or *STD may  be specified.

   FILESEP       The  number  of  file  separators  to  be used.    The
                 default is *SAME.  A number 0-9 may be specified.

   SCHEDULE      The  output  scheduling to  be used.   The  default is
                 *SAME.  A  value of *JOBEND,  *FILEEND, or *IMMED  may
                 be used.

   HOLD          Whether to  hold the spooled file  to prevent printing
                 until  release.   The default  is *SAME.   A  value of
                 *YES or *NO may be specified.

   SAVE          Whether to  save  the  spooled  file  after  printing.
                 The default is *SAME.   A value of *YES  or *NO may be
                 specified.

   OUTPTY        The  output priority to  be assigned.   The default is
                 *SAME.  A value of 0-9 may be specified.

   USRDTA        The user data assigned  to the file.   The default  is
                 *SAME.  A character value may be specified.

   USRDFNTXT     The  user defined  text  assigned to  the  file.   The
                 default is  *SAME.  A character value  up to 100 bytes
                 may be specified.

   USRDFNDTA     The  user  defined data  assigned  to the  file.   The
                 default is *SAME.   A character value up to  255 bytes
                 may be specified.

   RLSHLDSTS     A  *YES/*NO  option for  whether  to  release the  new
                 spooled  file if the  original spooled file  is in the
                 held status.

                 *NO is  the default  meaning the  new spooled  spooled
                 file  remains  in  the same  status  as  the  original
                 spooled  file.   *NO must  be  specified if  the OWNER
                 parameter is other than *SAME.

                 *YES may  be  specified  to release  the  new  spooled
                 file if the original is in the held status.

DUPSPLF2 Command                                      *CMD
----------------

The DUPSPLF2 is the old  form of the command and uses  a combination of
CPYSPLF and  CPYF to re-print the  spooled file.  This  is adequate for
DP  kind of output.  If you  have special printer attributes, they will
be  lost with  DUPSPLF2.    When  a spooled  file  is  output,  certain
parameters cannot be  changed by CHGSPLFA or DUPSPLF.   Attributes such
as CPI  can only be changed by re-printing the  file.  If you have need
to change one of the attributes  that cannot be changed by CHGSPLFA  or
DUPSPLF, you should consider the use of DUPSPLF2.

By default,  the QSYSPRT  file is  used to reprint.   A  different file
may be  named to allow reprinting  with different file characteristics.
An option also exists to delete the original spooled file.

When the file is reprinted, the owner  of the spooled file will be  the
user who issued DUPSPLF2.

Assume you have a  spooled file which was printed with  a specific font
and you wish  to reprint with a different  font and delete the original
spooled  file.  You would create a  special print file with the desired
font and then use the following type of command:

    DUPSPLF2   FILE(QPRINT) OUTQ(xxxx) PRTFILE(yyyy) DLTOLDSPLF(*YES)

The following are the command parameters:

   FILE          The spooled  file name to  be duplicated.   It may  be
                 either  an externally  described or  program described
                 file.

   JOB           The  qualified job  name of  the job with  the spooled
                 file.  The default is * meaning the current job.

   PRTFILE       The print  file to  be  used to  print the  new  file.
                 The  default  is  QSYSPRT.   The  file  cannot  be  an
                 externally described file.

   OUTQ          The  qualified  output queue  of where  the  new spool
                 file  should  be  duplicated  to.    The  default   is
                 *PRTFILE which is  the name of  the file named  in the
                 PRTFILE parameter.  The library defaults to *LIBL.

   SPLNBR        The file  number of the  spooled file.   This defaults
                 to   *ONLY.    *LAST  or  a  specific  number  can  be
                 specified.

   COPIES        The number of  copies to be  printed.  The default  is
                 1.  Up to 255 may be specified.

   NEWNAME       The name of  the new spooled file to  be created.  The
                 default  is  *PRTFILE  which  means  to  use  the name
                 specified in  the  PRTFILE parameter.   *FILE  may  be
                 specified to  use the  name from  the FILE  parameter.
                 A user specified name may also be entered.

   DLTOLDSPLF    A  *YES/*NO  option  for  whether  to  delete the  old
                 spooled file  or  not.   *NO  is the  default.    *YES
                 causes the  old spooled  file to  be deleted after  it
                 is duplicated.

Security considerations
-----------------------

The spool  API that causes  a 'create' of  a spooled file  is specified
as  *PUBLIC *EXCLUDE.  Because of this,  the CL program must be created
by a user  who has *ALLOBJ  authority and the  program is specified  as
USRPRF(*OWNER).

Because  of  the  program  adopt  function, this  allows  any  user  to
duplicate  any file.  To  prevent this, the command  and CL program are
authorized to the TAADUPSPLF authorization list.

Any  user of  DUPSPLF  must  have  *USE  authority  to  the  TAADUPSPLF
authorization list.

The API  requires that if  a new owner is  assigned to the  new spooled
file   that  the  user   running  the  command   have  *SPLCTL  special
authority.  To  provide for control,  the TAASPLDST authorization  list
is used to  determine if the user can  change the owner name.   This is
the same authorization list as used by the SPLDST tool.

The DUPSPLF2  command uses normal system authorization  to determine if
the  user can duplicate a  spooled file.  For  example, he must be able
to read the  spooled file.   The TAADUPSPLF  authorization list is  not
used.

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

You must  have *USE authority  to the TAADUPSPLF authorization  list to
use DUPSPLF.

You  must have  *USE authority to  the TAASPLDST  authorization list to
use other than OWNER(*SAME) on DUPSPLF.

DUPSPLF may not be used while the spooled file is still open.

The  DUPSPLF  command   has  no   programming  type  of   restrictions.
However, if  you cannot change a  specific attribute with  DUPSPLF, you
should consider the DUPSPLF2 command.

DUPSPLF2  uses CPYSPLF  to copy  the contents of  the spooled  file and
then reprints  the  file  using  CPYF.   Because  of  this,  there  are
several restrictions which may  cause the command to fail  or different
output to occur.  These include:

  **   The PRTFILE  parameter file (default  is QSYSPRT) must  have the
       same  file level  characteristics (such  as LPI,  overflow line,
       form size)  as the original  file.  The  CPI parameter may  vary
       to reduce or enlarge the output.

  **   No  advanced  printer functions  such  as  loading an  alternate
       character set are preserved.

  **   No special printer functions are preserved.

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

The following TAA Tools must be on your system:

          SNDCOMPMSG    Send completion message
          UNADOPT       Unadopt

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

None, the tool is ready to use.

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

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

   DUPSPLF       *CMD                      TAASPLD        QATTCMD
   DUPSPLF2      *CMD                      TAASPLD2       QATTCMD
   TAASPLDC      *PGM          CLP         TAASPLDC       QATTCL
   TAASPLDC2     *PGM          CLP         TAASPLDC2      QATTCL

Structure
---------

DUPSPLF  command
    TAASPLDC   CL program

DUPSPLF2 command
    TAASPLDC2   CL program
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top