|
|||||||
|
|
![]() |
|
|
|
|
||
|
Extract Reports from Disk Files Hey, Ted: I have a file that was created on an OS/390 mainframe and saved as a dataset (disk file). The file is a copy of a printed report, complete with carriage control characters. I downloaded the file to my iSeries and saved it as a physical file. How can I convert the file to a spool file? --Joseph OS/400 can handle those printer control characters. Run these commands to solve your problem. OVRPRTF FILE(QSYSPRT) CTLCHAR(*FCFC) CPYF yourfile TOFILE(QSYSPRT) The term *FCFC stands for "first-character forms control." The system interprets the first character of each line according to the following table.
Character Name Meaning
========= ======= ==================================
1 one Skip to new page before printing
space Single space before printing
0 zero Double space before printing
- hyphen Triple space before printing
+ plus Do not space (causes overprinting)
These are the most common FCFC control characters. In addition to these characters, characters 2 through 9 and A through C indicate a skip to the lines associated with channel numbers 2 through 12. You are not likely to run into those control characters, but if you do, you should be able to accommodate them by placing the proper values in the CHLVAL parameter of the Override with Printer File (OVRPRTF) command. The Copy File (CPYF) command creates a new spool file from the data in the disk file. Because the OVRPRTF command is in effect, the first character of each line is interpreted as a forms control character. You can also use this technique to rebuild a report with different characteristics. For example, suppose you have a spool file that was created at 10 characters per inch. The following sequence of commands creates a new spooled file at 15 characters per inch.
CRTPF FILE(QTEMP/SPLFDATA) RCDLEN(133)
CPYSPLF FILE(mysplf) TOFILE(QTEMP/SPLFDATA) +
CTLCHAR(*FCFC)
OVRPRTF FILE(QSYSPRT) CPI(15) CTLCHAR(*FCFC)
CPYF FROMFILE(QTEMP/SPLFDATA) TOFILE(QSYSPRT)
Notice that I created the disk file with a record length of 133. This allows for one control character and 132 characters of data. If your spool file has a record length other than 132, adjust accordingly. The Copy Spooled File (CPYSPLF) command places the report data in the physical file, with a forms control character in the first position of each record, like the file you received from the mainframe. The OVRPRTF command changes the print density to 15 characters per inch, causing the CPYF command to build a new spool file at 15 CPI. --Ted Related Articles
|
Editors
Contact the Editors |
| Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. |