× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Second time updation of record within the same loop.
  • From: booth@xxxxxxxxxxxx
  • Date: Fri, 16 Jun 2000 11:59:11 GMT

I bet it'd work differently if you moved line  3, 4, &5 after line N.

I'd make additional comments but this is the key one I think.  The rest 
will come to you soon.  )

_______________________
Booth Martin
Booth@MartinVT.com
http://www.MartinVT.com
_______________________




"Dileep Mahi" <dileep.mahi@wipro.com>
Sent by: owner-rpg400-l@midrange.com
06/16/2000 05:11 AM
Please respond to RPG400-L

 
        To:     <RPG400-L@midrange.com>
        cc: 
        Subject:        Second time updation of record within the same loop.

My code follows the following logic

DOU end of file.
Read the file.
If record is valid.
Search for matching record in some other file.
If search is successful, update records in file.
EndDo

My Problem is, after EOF, the same loop is getting executed again from the
start but only with the updated records and obviously the records are
getting updated for the second time again. This goes on and on and my
program never ends.

In this program,
    LR indicator is used to test the end of file in following fashion
1.            *INLR    DOUEQ    *ON
2.            'UB'        READEFILENAME            LR
3. NLR    COLDAT    IFGE    BRDATE
4.                        SETON                              LR
5.                        END
.................
..................
N.                        UPDATFILENAME
...................
X.                       END

While running the loop for second(or subsequent) time, if the condition in
line 3 is satisfied, the LR indicator is set to *ON and control is coming
out of the loop. Then other statements are being processed and the program
is ending.

I want this loop to end after processing the last record of the file. Any
suggestion in resolving this problem are worth a zillion appreciations...

Thanks in advance
Dileep Mahi



+---
| 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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.