The CPYPRTF command copies a SPOOL file to another SPOOL file, basically duplicating the SPOOL file. The copy of the SPOOL file may be placed in the same output queue or in a different output queue. The new SPOOL file's name may be the same or a different name may be specified.
In addition, several SPOOL file attributes such as HOLD, SAVE, COPIES and Page Range may be adjusted in the new copy.
Note that while the SPOOL may be copied to 1 or more output queues, the SPOOL file attributes are the same in each copy produced by the command.
To use CPYPRTF, type the command on the Command line, then press F4 to prompt it. If you have the COZSPLEXIT program installed, and you are on IBM i v6.1 or later, you may use option "C" next to any SPOOL file of the WRKSPLF, WRKJOB, and WRKOUTQ commands to evoke CPYPRTF. When prompted, you will see a display similar to the following:
The SPLFNAME parameter is the name of the existing SPOOL file. It will also be the name of the new SPOOL file in the targeted output queue.
The JOB parameter identifies the job that created the SPOOL file to be copied. The default JOB(*) indicating that the current job created the SPOOL file.
The SPLNBR parameter identifies which SPOOL file number whose name matches that specified on the SPLFNAME parameter is to be copied. The default is *LAST, and the valid choices are *ONLY, *LAST, *ANY or a valid SPOOL file number.
The NEWSPLF parameter is used to specify the name of the SPOOL file being created by the CPYPRTF command. The default is *SPLFNAME (or *SAME).
The OUTQ parameter is the target output queue where the new copy of the SPOOL file is placed. Up to 300 output queue names may be specified. The default is *SAME indicating the the copy is stored on the same output queue as the original SPOOL file.
The FORMTYPE parameter allows you to specify the FORM type for the copy of the SPOOL file.
The USRDTA parameter allows you to specify the User Data string for the copy of the SPOOL file.
The SAVE parameter allows you to specify the SAVE after print setting for the copy of the SPOOL file.
The HOLD parameter allows you to specify the HOLD attribute for the copy of the SPOOL file.
The COPIES parameter allows you to specify the number of COPIES for the copy of the SPOOL file.
The SPLFOWN parmeters allows you to specify the OWNER of the new SPOOL file.
Additional Parameters can be seen by rolling to the next page in the command prompter:
The EXPDATE parameter allows you to specify the date that the SPOOL file expires. Use the DLTEXPSPLF command to delete expired SPOOL files.
The PAGERANGE parameter sets the starting and ending page numbers to be printed in the copy of the SPOOL file. Specify either a from/to page range or specify a starting page number and the number of pages to be printed.
The PAGERANGE parameter is a 3-part parameter consisting of the following elements:
The WAIT parameter indicates if the command should wait for incomplete SPOOL files (those still in "OPN" status) to finish before attempting the copy. if *YES is specified, the command waits (this is the default) if *NO is specified, an error will be generated and the command does not copy the SPOOL file.
The CPYPRTF command is part of the COZTOOLS library available for public beta testing beginning May 1st, 2012 and becoming available for general use in early August.