Sorry - I missed the contiguous fields bit and thought you were loading records into an array.

In that case, the method in the article was exactly what you needed - and that is pretty much what Birgitta showed you.

The update should not be needed.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Sep 13, 2017, at 7:42 AM, JRusling@xxxxxxxxxxx wrote:

Thanks for the article Jon.

I am confus-ed, missing something or whatever. I am reading a single
record to load contiguous fields into an array(s).

Is the solution you propose below for a single record or for multiple
records...? like i said... i am confus-ed. :)


<snip>
The article you referenced (Found this Paris article, i'm trying to adapt
and use now ->


http://ibmsystemsmag.com/ibmi/developer/general/d-spec-discoveries/?page=2 <http://ibmsystemsmag.com/ibmi/developer/general/d-spec-discoveries/?page=2>
<
http://ibmsystemsmag.com/ibmi/developer/general/d-spec-discoveries/?page=2 <http://ibmsystemsmag.com/ibmi/developer/general/d-spec-discoveries/?page=2>
)

Is the "as designed" way to go - particularly if you wanted to avoid
pointers - which may cause issues for those who follow you since pointers
are not exactly common currency in the RPG world.

This is one of those interesting (and rare) cases when Multiple Occurrence
DS can work.

Just set the Occur level before you do the read.

By the way - as you have hopefully realized from the article - the POS
keywords are not needed. The fields will be contiguous in the DS anyway -
POS just confuses the issue I think.

Personally I would use a DS array defined with LIkeRec and use DS I/O.
Like So.

dcl-ds data LikeRec(recname);

index += 1;

Chain key filename data(index);

That is by far the simplest approach.

Jon Paris
</snip>
<br />
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx <mailto:RPG400-L@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l <https://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxx <mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l <https://archive.midrange.com/rpg400-l>.

Please contact support@xxxxxxxxxxxx <mailto:support@xxxxxxxxxxxx> for any subscription related questions.

Help support midrange.com <http://midrange.com/> by shopping at amazon.com <http://amazon.com/> with our affiliate link: http://amzn.to/2dEadiD <http://amzn.to/2dEadiD>

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].