IBM Support

Options to Generate a Copy or Multiple Copies of a Spooled File

Troubleshooting


Problem

This document explains the different options one might use to create a copy of a spooled file.

Resolving The Problem

At times, it may be necessary to generate one or more copies of a spooled file on the system. There are several different methods for generating a copy of a spooled file.

Note: Be aware that each of the following methods will duplicate the content of the spooled file; however, it does not create a duplicate copy of the spooled file. Each spooled file will have its own unique job name, job user and job number, as well as spooled file number.

Options to Generate a Copy or Multiple Copies of a Spooled File

1.Have the application generating the spooled file write the data two times, either to the same or different output queues. Discuss this option with the application programmer.
2.Use the Send TCP/IP Spooled File (SNDTCPSPLF or LPR) command to send the spooled file to another output queue on the system, for example:

SNDTCPSPLF RMTSYS(LOOPBACK) PRTQ('library/outq') FILE(spooled-file)
           JOB(999999/user-name/job-name) SPLNBR(999999) DESTTYP(*AS400)
           TRANSFORM(*NO) DLTSPLF(*NO) SEPPAGE(*NO)

Make sure that the LPD daemon job is started by doing a STRTCPSVR SERVER(*LPD) command.

Note: This method is valid for all types of spooled files.
3.Use the SNDNETSPLF command to send the spooled file to another user on the system.

SNDNETSPLF FILE(spooled-file) TOUSRID((user-id address))
           JOB(999999/user-name/job-name) SPLNBR(99999) DTAFMT(*ALLDATA)

SNADS must be configured and active for this method. For information on setting up SNADS, please refer to the following document

N1018347: Configuring SNADS and Setting Up SNA Distribution Services

Note: This method is only valid with *SCS and *AFPDS type spooled files.
4.Use the Copy Spooled File (CPYSPLF) command to copy the spooled file to a database file and then use the Copy File (CPYF) command to copy the data back out of the database file.

For more information on this method, please refer to the following document:

N1010238: Using CPYSPLF to Re-Create a Spooled File or Create a PC File

Note: This method is only valid with *SCS type spooled files.
5.Use the Create Spooled File (QSPCRTSP) API within an application to generate a copy of the spooled file. For more information on the QSPCRTSP API, refer to the Create Spooled File (QSPCRTSP) API topic in the IBM i5/OS Information Center, which is available at the following URL:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/QSPCRTSP.htm
6Consider a third-party application that will perform the desired function.

Adding Options for Invoking the CPYSPLF and SNDTCPSPLF Commands

Starting in V6R1M0 (6.1 or R610) i5/OS, the UIM Spooled File User-defined List Action exit point can be used to add options to invoke the Copy Spooled File (CPYSPLF) and Send TCP/IP Spooled File (SNDTCPSPLF or LPR) commands from the following green screen interfaces:

oWork with Printer Output (WRKSPLF ASTLVL(*BASIC))
oWork with Spooled Files (WRKSPLF ASTLVL(*INTERMED))
oWork with Job Spooled Files (WRKJOB OPTION(*SPLF))
oWork with Output Queue (WRKOUTQ output queue name)
oWork with Spooled File Status (D P or WRKSPLF DSPFMT(*S36FMT))

For more information, please refer to the following document:

N1012369: Adding Options to WRKSPLF, WRKOUTQ and WRKJOB to Invoke the CPYSPLF and SNDTCPSPLF Commands

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

Historical Number

553652781

Document Information

Modified date:
18 December 2019

UID

nas8N1012441