increase page numbers from 9999 to 999999 in a 2e print file function

Document ID : KB000015899
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

Increasing the page number printed above 9999.

Question:

We have a case of printing invoices that need the page number displayed but the page number printed only goes up to 9999 , we need this increased to 999999. Is there a way in 2e to change this ?

Environment:
IBM Iseries
Answer:

When there is a reference to the system field *PAGE in a PRTFIL Header/Footer, 2E generates the DDS keyword PAGNBR. 

An automatic facility that generates a page number on each page for you up to 9,999. 

There is no reference to this in the actual program for the PRTFIL. 

If you want to add and control your own page number then you will need to drop *PAGE field and add your own function field to the Device 

Design. 

Then in the program you can use EXCUSRSRC to define and manipulate the field as you wish.