Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Handling overflow in a print file?

Status
Not open for further replies.

InfoCorp

Programmer
Mar 18, 2004
10
0
0
US
What is the best way to handle overflow in a print file? Any help would be greatly appreciated.
 
Tell us what you mean,,,, do you count for the lines per page, or have a overflow indictaor. What problems are you having??
 
I found a IBM data stucture that will tell the actual page that I am on and I am checking from that to see when I need to go to a new page and print my headings on a new page. Thanks for the help any ways.
 
Normally you assign an indicator on the file description line for the printer (such as *inOF)

Then, in your pgm, check if *inOF is on

if *inOF;
except headings;
endif;

or - if using the RPG cycle, just code the Output specs to print headings on indicator OF

 
With an external printer file, you can't use *INOF, *INOA, etc. - it has to be *IN01 - *IN99. Why, I dunno - but that's the way it always has been.

Ypo ue the "special" overflow indicators only with program described printer files (QSYSPRT, QPRINT, and so on).

De mortuis nihil nisi bonum.

 
Yes, on your print files, if you specify

Code:
     FCUTTC226  O    E             PRINTER OFLIND(*IN40)

Then, if indictor 40 is on, you have to print a new header. I like to use named indicators. To define that you do something like this:

Code:
       // Named Indicators
     D IndicatorPtr    S               *   Inz(%Addr(*IN))
     D                 DS                  Based(IndicatorPtr)
     D NewPage                40     40N   Inz(ON)                              New Page?

     D YES             C                   Const('1')                           Indicator = *On
     D NO              C                   Const('0')                           Indicator = *Off

Then you can have a routine like the following:

Code:
       //*************************************************************************
       // $printHeader - Print the header on the page
         begsr $printHeader;

           if NewPage;
             write header;
             NewPage = NO;
           endif;

         endsr;    // $printHeader

On something like that. I hope this helps!

iSeriesCodePoet
iSeries Programmer/Lawson Software Administrator
[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top