× 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.




Roger Vicker <rvicker@vicker.com> wrote:

>As far as a "CHAIN not resulting in an EOF" I can agree that it
>shouldn't but again from the FILE view it can result in a
>%NOT(%EOF) if successful. I wonder, with an un-successful
>CHAIN what is the cursor status?

An unsuccessful CHAIN does not set the current record pointer. I wasn't
sure, however, whether it alters the current position so I ran a little
test (with the OPM RPG compiler at V4R2M0), and I discovered that an
unsuccessful CHAIN does not affect the file position, and a subsequent READ
will retrieve the record logically following the previously successful
READ. Following a successful CHAIN, of course, the file is repositioned and
a READ retrieves the record following the one retrieved randomly.

On RTFMing, I found that both the OPM and ILE manuals state that the file
must be repositioned following an unsuccessful CHAIN. That being the case,
I suppose we have to believe the manual and regard the actual behaviour of
the compiled program as an unsupported feature - next release it might
suddenly start behaving like it says in the book, so don't rely on it.

Jon???

>Also, if we want to get picky <grin> then a READE and READPE
>may or may not cause an actual %EOF when the records
>matching the key are exhausted. If  there are keys greater than
>the factor 1 then the READE is not really %EOF but is
>%NOT(%FOUND).

It's at end of file in the sense that the file is no longer positioned. An
unkeyed sequential read will not retrieve a record following an
unsuccessful READE. This is what the manual says, and in this case what the
manual says appears to be what happens.

Dave Kahn, ABB Steward Ltd.


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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.