CPYSPLF3 COPY SPOOLED FILE 3 TAASPPP |
The Copy Spooled File 3 command splits a spooled file into multiple
spooled files based on a change in value of the data at a specific
line and position of each page. Assume you have a report by salesman
for all salesmen and want to split the report so there is a separate
spooled file for each salesman. The salesman number must be listed
at the same location on each page, but does not have to be on the
first line.
A typical command would be:
CPYSPLF3 FILE(xxx) CMPLINE(10) CMPPOS(3) CMPLEN(6)
The spooled file would be converted to a data base file and read.
The data from line 10 would be extracted for the compare position and
length. A record would be written to a temporary file in QTEMP with
the page number and the compare value.
A second pass of the converted information would be read, a temporary
data base member would be created for each unique value and the pages
with the same value written to the member. Each member would then be
read by a program and a unique spooled file created.
The spooled file name of the new spooled files would be the same as
the original spooled file with a '2' added at the end. If the name
is already 10 bytes in length, the 10th character is changed to '2'.
The spooled file used by the tool for the additional spooled files is
TAAPRT2. The same page size and width of the original spooled file
are used as well as the same output queue. You can override the
attributes of TAAPRT2 by using an OVRPRTF command before running
CPYSPLF3. For example, assume you wanted all the new spooled files
in a separate output queue.
OVRPRTF FILE(TAAPRT2) OUTQ(xxx)
Note that if a page number exists on each page, the same page number
would be output. The program that creates the original spooled file
could reset the page number for each unique value
Spooled file attributes
-----------------------
Not all spooled file attributes are overridden to the new spooled
files. You can issue your own OVRPRTF command to TAAPRT2 if a needed
attribute is missing.
CPYSPLF3 escape messages you can monitor for
--------------------------------------------
TAA9891 Unable to split spooled file.
Escape messages from based on functions will be re-sent.
CPYSPLF3 Command parameters *CMD
---------------------------
FILE The spooled file name to be split into multiple
spooled files.
CMPLINE The line where the compare value exists. The is the
line as seen on printed output or by using the
DSPPRTSPC tool. Blank lines count as 1. It must be
a value between 1 and 99.
CMPPOS The first position of the compare data on the line.
It must be a value between 1 and 378.
CMPLEN The length of the data to be compared. It must be a
value between 1 and 60.
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
------------
The program that outputs the spooled file to be split must ensure
that the correct compare data exists on each page of output. A
unique spooled file will be created each time the value differs.
Not all spooled file attributes are overridden to the new spooled
files.
Prerequisites
-------------
The following TAA Tools must be on your system:
EDTVAR Edit variable
RMVMSGKEY Remove message key
RTVDBFA Retrieve data base file attributes
RTVSPLFA Retrieve spooled file attributes
RTVSYSVAL3 Retrieve system value 3
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
------ ---- --------- ---------- ----------
CPYSPLF3 *CMD TAASPPP QATTCMD
TAASPPPC *PGM CLP TAASPPPC QATTCL
TAASPPPC2 *PGM CLP TAASPPPC2 QATTCL
TAASPPPR *PGM RPG TAASPPPR QATTRPG
TAASPPPR2 *PGM RPG TAASPPPR2 QATTRPG
TAASPPPR3 *PGM RPG TAASPPPR3 QATTRPG
Structure
---------
CPYSPLF3 Cmd
TAASPPPC CL pgm Main program
TAASPPPR RPG Pgm Reads splf data - writes TAATMPN
TAASPPPR2 RPG Pgm Reads splf data - creates members TAAMBRP
TAASPPPC2 CL Pgm Reads members in TAAMBRP
TAASPPPR3 RPG Pgm Writes new spooled files
|
Added to TAA Productivity tools April 15, 2012