HOME

FORUM

UPLOAD SOURCE

RPGLE/RPG

CLLE

SQLRPGLE

DDS

API

OTHER

JAVA

IFS

HTML

JAVA SCRIPT

PHP

MYSQL

XML

OLE DB



    
Enter keyword to search code examples.


Welcome to Code400.com   

Okay...We all like to get free stuff..Right?!? Well thats what we are offering here....Free Stuff
  1. Free storage for your source code.
    Post Your Source

  2. Free access to code samples. (site search)

  3. Free place to ask questions or just say what you want. 
    Share your thoughts

We are interested in what you have to say. If you can’t find what your’e looking for on this site....   Tell us  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 Quote

Choose 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:
  1. Page size (PAGESIZE)
  2. Lines Per Inch (LPI)
  3. Characters Per Inch (CPI)
  4. Source drawer (DRAWER)
  5. Font identifier (FONT)
  6. Print quality (PRTQLTY)
  7. 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.

About Code400.com | resume | Search | Site Map | Suggestions
© Copyright 2003-2008 Code400.com



Wednesday Mar 10, 2010 @ 4:20 AM