Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
Howdy,
I get a file ftp-ed on my system from a remote system. The file is a flat file containing invoices that have been invoiced on the remote machine. The file is generated on the remote machine during invoicing but looks exactly like it has been copied from a spooled file to a flat file using command CPYSPLF with CTLCHAR(*PRTCTL). The file would typically look something like below:
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8.... 003 INVOICE 1 Page 1 2 Invoicedate Customer ID 1 11-09-26 A040 1 Invoice ID 1 111513 2 Invoice address 1 Joe's nails and spikes 2 5 Hammarroad 1 Albany NY 025 Description Qty Amount 1 ------------------------------------------------------------ 1 Golden hammer 1 500.00 062 Amount VAT % VAT Amount 1 500.00 10.00 50.00 550.00 USD
Now here's for the question: is there any way to print this file in the intended layout without creating a program to format it properly before printing?
I reckon the answer to this question is no but I thought and check with you guys before setting of and creating a program to do this (or ordering a .pdf instead)
Thanks for any tips,
Paulster
Press help on the CPYSPLF command and read the layout for *PRTCTL. Most options can be easily reproduced with an RPG pgm or a simple CPYF command.
Next time ask them to CPYSPLF ... CTLCHAR(*FCFC). You then do
OVRPRTF QPRINT ... CTLCHAR(*FCFC)
CPYF file QPRINT
DLTOVR QPRINT
Unfortunately there is no OVRPRTF CTLCHAR(*PRTCTL).
Any non-externally described printer file will work. If you do this regularly, you might want to CRTPRTF with appropriate PAGESIZE() and so forth, to save yourself typing (and remembering) all of the keywords from your OVRPRTF.