|
What's the value of sflpag? The loop control variable, not the DSPF keyword. > -------- Original Message -------- > Subject: RE: Why does this loop only pick up the first rec of a group > From: steema@xxxxxxxxxxxxx > Date: Wed, December 28, 2005 10:48 am > To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> > > Thank you Joe. This is the DDS for the subfile pag. I know the problem > is in the initial build bec. I debugged at that point and the records are > not correct. > > A R SFL1 SFL > A* > A 74 SFLNXTCHG > A OPTION 1A B 10 3VALUES(' ' '2' '4' '5') > A BAACCT R O 10 7REFFLD(ZZF01/BAACCT *LIBL/M > A BAINVN R O 10 21REFFLD(ZZF01/BAINVN *LIBL/M > A BABOL R O 10 38REFFLD(ZZF01/BABOL *LIBL/M > A BAPRO R O 10 56REFFLD(ZZF01/BAPRO *LIBL/M > A BASTAT R O 10 74REFFLD(ZZF01/BASTAT *LIBL/M > A R SF1CTL SFLCTL(SFL1) > A* > A CF06 > A SFLSIZ(0013) > A SFLPAG(0012) > A ROLLUP > A OVERLAY > A N32 SFLDSP > A N31 SFLDSPCTL > A 31 SFLCLR > A 90 SFLEND(*MORE) > A RRN1 4S 0H SFLRCDNBR > A 9 7'ACCT#' > A DSPATR(HI) > A 9 21'INVOICE' > A DSPATR(HI) > A 9 37'BOL # ' > A DSPATR(HI) > A 4 2'POSITION TO . . . ACCT' > A PACCT R B 4 30REFFLD(ZZLF01/BAACCT *LIBL/M > A DSPATR(HI) > A 9 2'OPT' > > > Here is some code I switched back to one file. I was trying to read one > and update another but it is the same basic code. > > c* Clear then build the initial subfile > C exsr clrsf1 > C exsr sflbld > C* > C dou cfkey = exit > C write fkey1 > C exfmt sf1ctl > * Process position to information entered by the user, then clear > > C select > C when (cfkey = enter) and (pacct <> *blanks) > C *loval setll mllc1wa > C exsr clrsf1 > C exsr sflbld > C clear pacct > c when (cfkey = enter) > C exsr prcsfl > * > C when (cfkey = rollup) and (not *in32) > C exsr sflbld > > C when cfkey = cancel > C leave > > C endsl > C enddo > > C eval *inlr = *on > > > C clrsf1 begsr > * > * Clear relative record numbers and subfile > * > C eval rrn1 = *zero > C eval lstrrn = *zero > C eval *in31 = *on > C write sf1ctl > C eval *in31 = *off > C eval *in32 = *off > C endsr > > > C sflbld begsr > * > * Make RRN1 = to the last relative record number of the subfile > * so that the load process will correctly add records to the bot > > * > C eval rrn1 = lstrrn > * > * Load the subfile with one page of data or until end-of-file > * > C do sflpag > C read zzlc1wa 90 > C if *in90 > C leave > C endif > C eval rrn1 = rrn1 + 1 > > C eval option = *blank > C write sfl1 > C enddo > * If no records are loaded to subfile, don't display it > * > C if rrn1 = *zero > C eval *in32 = *on > C endif > * > C eval lstrrn = rrn1 > * > C endsr > > > > > > > > There is a lot of information missing from your post, and perhaps a couple > > of misconceptions. > > > > First, why do you think we need to know about the KLIST asbkey? It is not > > used in your code, so it's irrelevant to the problem. > > > > Second, at the very minimum we would have to know the contents of sflpag, > > as > > well as the code that initially positions the mllc1wb file (if any). It > > would probably be good to see the line of code that defines rrn1 to be the > > subfile record number for sfl1, as well, but we can take your word for > > that > > one. > > > > Finally, it would be nice to know WHICH record was written to the subfile. > > > > Joe > > > > > >> From: steema@xxxxxxxxxxxxx > >> > >> the file has records as such: > >> > >> 50079 1 1 60,239,717 1 > > (...) > >> 50079 1 1 60,239,723 7 > >> .. > >> > >> C do sflpag > >> C read mllc1wb 90 > >> C if *in90 > >> C leave > >> C endif > >> C eval rrn1 = rrn1 + 1 > >> C eval option = *blank > >> C write sfl1 > >> C enddo > >> > >> Yet the subfile only loads the first record > > > > > > -- > > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > > To post a message email: RPG400-L@xxxxxxxxxxxx > > To subscribe, unsubscribe, or change list options, > > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > > or email: RPG400-L-request@xxxxxxxxxxxx > > Before posting, please take a moment to review the archives > > at http://archive.midrange.com/rpg400-l. > > > > > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l.
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.