The Copy Spooled File 4 command splits a spooled file into multiple
spooled files based on the number of pages specified. For example
you may have a report with 100 pages and you want to split into 10
spooled files of 10 pages each. Or you may have a 20 page report and
you want a separate spooled file for each page.
A typical command would be:
CPYSPLF4 FILE(xxx) PAGES(5)
The named spooled file must have at least 5 pages. If the spooled
file had 22 pages, 4 new spooled files would be created with 5 pages
each and the 5th new spooled file would have 2 pages. Assuming the
name of the original spooled file was ABC, the new spooled files
would be ABC1, ABC2, ... ABC5.
If PAGES(1) had been specified, the spooled file names would be ABC01
... ABC22.
Handling of spooled file attributes
-----------------------------------
The existing spooled file attributes are retrieved from the named
file and used on an OVRPRTF command for the new file(s). This
includes:
PAGESIZE
LPI
CPI
OVRFLW
FOLD
FONT
PAGRTT
JUSTIFY
OUTQ
FORMTYPE
FILESEP
SCHEDULE
HOLD
SAVE
OUTPTY
You cannot override these values. You can override one of the
parameters not specified by using OVRPRTF before CPYSPLF4 and specify
the TAAPRT1 file name.
CPYSPLF4 escape messages you can monitor for
--------------------------------------------
TAA9891 The PAGES parameter must be less than or equal
to the number of pages in the named spooled file.
TAA9892 The length of the NEWSPLFNAM value must allow for
enough digits to be added to create the new
spooled file names.
Escape messages from based on functions will be re-sent.
CPYSPLF4 Command parameters *CMD
---------------------------
FILE The spooled file name to be split into one or more
spooled files.
PAGES The number of pages to be contained in each created
spooled file. For example, if the number of pages
in the named spooled file is 44 and PAGES(5) is
specified, the first 8 spooled files will have 5
pages and the 9th spooled file will have 4 pages.
The number of PAGES must be less than or equal to
the number of pages that exist in the named spooled
file.
NEWSPLFNAM The generic name of the new spooled files that will
be created. *SPLF is the default meaning the same
name as the named spooled file.
If FILE(ABC) NEWSPLFNAM(*SPLF) is specified, and
less than 10 spooled files will be created, the
names will be ABC1 ... ABC9. If 10-1000 spooled
files will be created, the names will be ABC01 ...
ABC99.
The maximum size of the spooled file may be 999,999
pages which would generate a 6 digit suffix.
There must be sufficient room to add the appropriate
number of digits for the new spooled file name. For
example, if FILE(ABCDEFGHI) NEWSPLFNAM(*SPLF) is
specified and 15 spooled files should be created, an
escape message will occur because the generated file
names will exceed 10 characters. You could use
FILE(ABCDEFGHI) NEWSPLFNAM(aaaaa) to avoid the
error.
JOB The job name which contains the spooled file. An *
is the default meaning the current job. A fully
qualified job name may be used.
SPLNBR The spooled file number. This is the same
definition as on CPYSPLF. The default is *ONLY. A
specific number or *LAST may be used.
Restrictions
------------
You cannot override the parameters described earlier.
The program that creates the spooled file must skip to a new page for
an overflow rather than add print lines which would cause an
overflow.
The maximum size of the spooled file may be 999,999 pages which would
generate a 6 digit suffix.
Prerequisites
-------------
The following TAA Tools must be on your system:
DIVIDE Divide
EDTVAR Edit variable
RMVMSGKEY Remove message key
RTVSPLFA Retrieve spooled file attributes
RTVSYSVAL3 Retrieve system value 3
RTVVALA Retrieve value attributes
SNDCOMPMSG Send completion message
SNDESCINF Send escape information
SNDESCMSG Send escape message
SNDSTSMSG Send status message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
CPYSPLF4 *CMD TAASPPX QATTCMD
TAASPPXC *PGM CLP TAASPPXC QATTCL
TAASPPXC2 *PGM CLP TAASPPXC2 QATTCL
TAASPPXR *PGM RPG TAASPPXR QATTRPG
|