|
 |
 |
 |
Welcome to Code400.com
|
Okay...We all like to get free stuff..Right?!?
Well thats what we are offering here....Free Stuff
- Free storage for your source code.
- Free access to code
samples. (site search)
- Free place to ask questions or just say what you want.
We are interested in what you have to say.
If you can’t find what your’e looking for on this site....
We will add it.
The small print says: We provide the source code on this site as only
a guide. We do not recommend that anyone run any of the code provided
on this site without first testing it.
If you choose to download source from this site directly onto
your production box without testing....Well, YOU are completely to
blame and we don’t want to hear about it.
Random QuoteChoose your pleasures for yourself, and do not let them be imposed upon you.
Lord Chesterfield
| |
 |
 |
|
|
Using CPYSPLF to Re-Create a Spooled File or Create a PC File
Document Description
This document shows different uses of the Copy Spooled File (CPYSPLF)
command including how to re-create a spooled file with different
attributes or how to create a PC file from an existing spooled file.
Note: The CPYSPLF command does not work on *AFPDS, *IPDS, or
spooled files with control characters and replace unprintable set
to *NO in the spooled file attributes.
Copying a Spooled File to a Database File
Saving the Spooled File to Media
Restoring the Spooled File from Media
Example 1: Creating a New Spooled File with Different Attributes
To generate a new spooled file with different attributes, do the following:
1 Use one of the following Create Physical File (CRTPF) commands to
create a database file to store the data from the spooled files.
The command to be used depends on the page width specified in the
spooled file attributes. If the page width is 132, use the following
command to create a database file with a record length of 133 bytes:
CRTPF library/database_file_name RCDLEN(133) MAXMBRS(*NOMAX) +
SIZE(*NOMAX) LVLCHK(*NO)
If the page width is 198, use the following command to create a database
file with a record length of 199 bytes:
CRTPF library/database_file_name RCDLEN(199) MAXMBRS(*NOMAX) +
SIZE(*NOMAX) LVLCHK(*NO)
2 Use the following Copy Spooled File (CPYSPLF)
command to copy the data from the spooled file to
the database file:
CPYSPLF FILE(spooled_file_name) JOB(number/user/job) +
TOFILE(library/database_file_name) TOMBR(database_member_name) +
CTLCHAR(*FCFC)
3 Use the Override with Printer File (OVRPRTF)
command to override the settings of your printer
file, for example:
OVRPRTF QSYSPRT CTLCHAR(*FCFC) CHLVAL(*NORMAL) +
PAGRTT(0) OUTQ(library/outq) OVRSCOPE(*JOB)
This particular command overrides the QSYSPRT system-supplied printer
file to set the Degree of page rotation (PAGRTT) parameter to 0.
This will cause the new spooled file to print in portrait instead of
landscape. The printer file used for the original spooled file can be
used instead of QSYSPRT, or *PRTF can be specified to override all printer
files. Also, other parameters besides PAGRTT can be overridden including,
but not limited to, the following:
- Page size (PAGESIZE)
- Lines Per Inch (LPI)
- Characters Per Inch (CPI)
- Source drawer (DRAWER)
- Font identifier (FONT)
- Print quality (PRTQLTY)
- Print on both sides (DUPLEX)
Note: The Override Printer File (OVRPRTF) command above includes
not only the page rotation (PAGRTT) parameter, but also has the
control character (CTLCHAR) parameter set to *FCFC and the channel
values (CHLVAL) parameter set to *NORMAL. This will cause the Copy
File (CPYF) command to handle the First Character Form Control
information in the database file using the normal rules. It is also
recommended that the Override scope (OVRSCOPE) parameter be set to
*JOB to ensure that the OVRPRTF command takes affect at ALL call
levels in the job. Without this, the OVRPRTF command may not take
affect at all which would result in losing all line and page breaks
in the new spooled file.
4 Use the following Copy File (CPYF) command to copy the
database file member to a new spooled file:
CPYF FROMFILE(library/database_file_name) FROMMBR(database_member_name) +
TOFILE(QSYSPRT)
Note: This example specifies the QSYSPRT system-supplied printer
file in the TOFILE parameter, but another printer file can be specifed,
such as the printer file used for the original spooled file. Regardless,
this should match the printer file overridden by the Override with Printer
File (OVRPRTF) command, unless all printer files were overridden by
specifying *PRTF.
|
| |