Q
Manage Learn to apply best practices and optimize your operations.

Copying a physical file back to a spool file

ISeries expert Ken Graap explains how to copy a physical file back to a spool file.

You can use the CPYSPLF (Copy Spool File) command to copy a spool file to a physical file. How do you copy it back to a spool file?

The basic commands to copy a spool file to a database file and back again are as follows:

1. Create a physical file large enough to hold the data and the format control character
CRTPF FILE(QTEMP/TEST) RCDLEN(133)

2. Copy the spool file into this file along with the format control characters
CPYSPLF FILE(QPRINT) TOFILE(QTEMP/TEST) JOB(123456/User/Jobn) SPLNBR(1) CTLCHAR(*FCFC)

3. To create a spool file again, use the CPYF command
CPYF FROMFILE(QTEMP/TEST) TOFILE(QSYSPRT)

When this spool file is sent to a printer, the printer will recognize the data in Column 1 as format control characters and print the file correctly.

Dig Deeper on Data backup, storage and retrieval on iSeries

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

How to copy only third page of spool file to PF?
Cancel

-ADS BY GOOGLE

SearchDataCenter

Close