|
Actually, I knew that, and I think that's what was throwing me off. I know Excel and Lotus 123 and a ton of other spreadsheet type things. I'm trying to understand, though, what he means by "getting a correct answer at the row level but not at the column level". Does that mean that his totals aren't adding up across the record? Or that at the very end they don't add up? Or he doesn't know how to use a running total? Okay, you want to "setup a counter to read a record within a DOWHILE loop". You set up a variable, such as CompanyTotal and GrandTotal. Clear these values to zero. After every read you say something like: EVAL CompanyTotal = CompanyTotal + RecordTotal EVAL GrandTotal = GrandTotal + RecordTotal or ADD RCDTTL COMPTTL ADD RCDTTL GRNDTTL depending on what version of RPG you are using. After you reach a new company number, print out an exception stating the subtotals and clear your company totals to zero, leaving your grand totals alone. Then, after you reach the end of file, print out your grand totals. Is this what you were looking for? Regards, Jim Langston End of the Trail wrote: > Phil: > > You got to talk 400 not PC. I think you are trying to say the record(row) > counter is adding up. Now you need another variable to accum your Data > Field(column) into. Data manipultors (PC'ers) speak in spreadsheet terms. > A row is a RECORD and column is a FIELD of the RECORD(row). > > -----Original Message----- > From: Jim Langston <jlangston@conexfreight.com> > To: RPG400-L@midrange.com <RPG400-L@midrange.com> > Date: Wednesday, September 08, 1999 9:22 AM > Subject: Re: I am new to RPG language...need some pointers! > > >I don't quite understand your problem. You say you are getting the correct > >total for the number of records, but not for your additions of the columns? > > > >Regards > > > >Jim Langston > > > >Phil & Vera Hayes wrote: > > > >> How do you set a counter to read a record at a time within a DOWHILE > loop? I > >> am getting a correct answer to the row level, but not on the column level > or > >> grand total. This would help greatly!!! > >> > >> Phil > >> > >> +--- > >> | 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 > >> +--- > > > >+--- > >| 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 > >+--- > > +--- > | 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 > +--- +--- | 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-2025 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.