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



Charlie,

I've always thought of the "Random" in "Random Retrieval from a File" as a reference to how the programmer wants to access the data (as opposed to sequential - READ/READE) rather than what the OS will return.

In the OP's example, when the file has 2 keys I would expect CHAIN KEY1 FILEX; to always return the same record, no randomness to it, and that record should be the first record with the first key that satisfies the second keys collating sequence (or FIFO/LIFO/FCFO etc. as Chuck pointed out when there are duplicates) for a blank/zero key.

I personally can’t see how that could ever be affected with a subsequent release of the OS, it is the expected behavior for files with compound keys. If it changed, I think there'd be a whole load of broken software our there...

Crispin.

The definition of Chain is a Random Retrieval from a File.

If IBM tells me something is random, I take that to heart.

Because, how the database retrieval works today might not be how it works
under a different version of the operating system. There are too many
variables to try and decipher. (does your file reuse deleted records? If all
logical files are deleted and rebuilt, the sequence they are rebuilt in also
can have an effect)

As others have suggested, to eliminated all doubt, sounds like you should be
using SETLL and READE.

Documentation is the IBM RPG ILE Programmer Reference.
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Frzasd%2F
sc092508914.htm

Chain has been defined as random retrieval for as long as I can remember.

Charlie


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.