CL Command Reference - CPYSPLF

CL Command List > CPYSPLF Reference

Description:

The Copy Spooled File (CPYSPLF) command copies the data records in the specified spooled file to a user-defined physical database file. This conversion allows the use of spooled files in applications using microfiche, data communications, or data processing. Print lines that are all blank are not copied. When you copy a spooled file to a physical file, certain information is lost or changed. For example:
. Graphics data is lost.
. Bar code data is lost.


Examples:

Example 1: Replacing Data

CPYSPLF FILE(QPRINT) JOB(PAYROLL01) SPLNBR(4)
TOFILE(MYFILE) TOMBR(MYMBR) CTLCHAR(*PRTCTL)

In this example, file QPRINT (which is the fourth file produced by job PAYROLL01) is copied to member MYMBR of physical file MYFILE (which resides in a library found by searching the library list). The newly copied data replaces all old data in the member because all old records have been cleared. The 4-byte print control code is created.



Example 2: Adding Data

CPYSPLF FILE(QPRINT) TOFILE(MYLIB/MYFILE) JOB(PAYROLL02)
MBROPT(*ADD) CTLCHAR(*FCFC) CHLVAL((1 3) (4 15))

In this example, file QPRINT (the only file of that name left in job PAYROLL02) is copied to the first member of the physical file found in library MYLIB. The newly copied data is added to data existing in the member. The FCFC 1-byte print control character is used and takes advantage of the assigned channel values in formatting the output. The assigned channel values as specified on the command are as follows:
. Line 3 assigned to channel 1
. Line 15 assigned to channel 4