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



On 2012/11/7 1:53 PM, Vernon Hamberg wrote:
The key length is specified in the F-spec = I believe it has to start in
position 1 of the record, but I can't say that for sure.


The key layout is independent of the record layout. You could have fields A B C D E and keys B D. If each of those fields was 10 bytes long, the *INPUT data structure would be 50 bytes long and the *KEY data structure would be 20 bytes long. It would work fine to use that 20 byte structure as the key for CHAIN or SETLL even though the relative positions of B and D are different in the key and the record.

The RPG F spec still has an entry for the start position of the key, but it's ignored beyond a sanity check by the RPG compiler.

Database knows where the keys are in the record. I guess there must have been a system some time in the past where it was possible to have a flat file with true program-described keys, where the key type and location really was determined by the RPG F spec. But that's not possible now on the IBM i, and I'm pretty sure it was never possible on the AS/400 or even the System 38. You can't do keyed access against a file that doesn't have "official" keys.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.