Q

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.

This was first published in April 2008
This Content Component encountered an error

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close