Midrange News for the IBM i Community


Posted by: Paulster
Freelancer/Consultant
PvD Consultancy AB
Sweden and The Netherlands
Print invoice from physical file with CTLCHAR(*PRTCTL)
has no ratings.
Published: 19 Oct 2011
Revised: 23 Jan 2013 - 1585 days ago
Last viewed on: 27 May 2017 (3883 views) 

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.

Print invoice from physical file with CTLCHAR(*PRTCTL) Published by: Paulster on 19 Oct 2011 view comments(2)

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

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Print invoice from physical file with CTLCHAR(*PRTCTL)
Posted: 5 years 7 months 9 days 12 hours 26 minutes ago

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. 

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Print invoice from physical file with CTLCHAR(*PRTCTL)
Posted: 5 years 7 months 9 days 11 hours 59 minutes ago

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.