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



And to counter Brian's counter ... <grin>

Using the DS often forces you to copy the data into the DS elements. Using a list of key fields does not require this making it easier to use a key from multiple sources without copying. Also it permits the use of constants, literals, and anything else that a CONST parameter construct can handle - so just all round more flexible.


Jon Paris

On Aug 18, 2021, at 3:20 PM, Brian Parkins <goodprophet.bp@xxxxxxxxx> wrote:

No strong feelings either way, just a counterpoint re. maintenance.

For (1) the DS will be defined in one place and can be used throughout the code, (CHAIN, READE, etc.) If the key structure were to change - or a coding error encountered - only one place to correct. No need to search for the in-line definitions. (Same philosophy as when using Named Constants - define in one place only.)

I agree (2) is more readable.

Brian.

On 18/08/2021 14:24, Alan Cassidy wrote:
A question about using a data structure key list for record i/o vs. listing the keys in the i/o line.

(1) chain %kds( CustkeysDS ) Custfile ;

--versus-

(2) chain ( CustType : CustNbr ) Custfile ;

I like the #2 syntax better, for showing the actual key value arguments inline, at the sttement itself, as more maintenance-friendly, even if the arguments' field names are from the file itself. I'm mostly wondering if anybody knowss whether there are any performance differences?

--Alan Cassidy

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