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



Probably KEYLOC is a legacy keyword that was left in place for compatibility/documentation reasons. I can't think of any reason for the compiler to actually use the information provided. The key to be used is supplied as single field (or DS) to the CHAIN and is passed to the database management system as a separate entity - not embedded in a record buffer or anything.There is really no reason to use the information because, while the file may be internally described by the program, it is externally described to the system and it know exactly where the key actually is.

It would need Barbara or someone else on the compiler team to confirm it, but I suspect it is a no-op probably left in place to document to the maintenance programmer where the key is supposed to be


Jon P..

On Aug 8, 2022, at 2:10 PM, John Yeung <gallium.arsenide@xxxxxxxxx> wrote:

I'm maintaining some old code, and came across an instance where a
program-described file has a key defined incorrectly, because it
specifies a KEYLOC value different from where the key data really is.

But when testing it, chains always seem to work fine, same as when the
correct start position is specified. I kept trying different KEYLOC
values, including some that are not even anywhere near the actual key
data, and even tried not including a KEYLOC at all, and the program
always worked the same.

I am wondering how that is possible. I was really expecting the chains
to be horribly wrong unless KEYLOC was specified correctly, but
somehow it's never a problem. KEYLOC seems to have literally no effect
whatsoever.

I know this isn't much information to go on, but I don't know what is
relevant, so I don't know what else to provide.

John
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


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.