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
Related Q&A from Ken Graap
The BRMS Network feature allows a BRMS system to connect to other BRMS systems via a network, and enables a user to consolidate media such as backup ...continue reading
The only option to correct damage preventing file journaling is to use the RCLSTG command.continue reading
Find out if log files can be omitted during a save without causing problems in a full restore.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.