|
Quick Version: I am changing a program's O'specs from this: OAGEDRCVBD 104 L8 O OR OFNL8 O 7 'AR0245' to this: OAGEDRCVBD 104 OF O 7 'COLL03' How do I get the S/36 program to print the header first before any records are printed out? Long Version: I am modifying a S/36 PRG program that, of course, uses the RPG cycle. It was originally using 2 level indicators, one for company number (L8), one for customer number (L2). On customer number it was doing a page break on the O spec, with: OAGEDRCVBD 104 L8 O OR OFNL8 O 7 'AR0245' If L8 was on or the overflow (OF) was on and L8 was off. This worked fine. Now the problem. They wanted me to modify this program to show all invoices by customer, then sort by company. So, I changed the sort specs, no problem. I go through the program and reverse L8 and L2 since the breaks are now opposite levels, no problem. My only problem now is the very first record. It prints on a page by itself, without headers, then a page break, and the report starts. Since I'm not doing a page break on customers but only on overflow and it should be the first time, I changed the O specs to: OAGEDRCVBD 104 OF O 7 'COLL03' Everything works perfectly, except now I don't get my headers on my very first page. It prints level break headers for the customer number, and the very first detail record, then skips to a new page and everythign is perfectly fine after that. I added an SETON OF in my first time block (the old, if N99 DO... SETON 99 type) hopting that would work, but it seems it doesnt' check OF until after it prints something. The only thing I can think of doing is use a new indicator and just set it on for the first time processing and add that to my O spec ( OAGEDRCVBD 104 50 O OR OFNL8 O 7 'AR0245' then add to my first time block SETON 50 and after the first time block do a IF N99 SETOF 50 Any better suggestions? Regards, Jim Langston Manager of Hating S/36 code with a passion. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.