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



--
--
[ Picked text/plain from multipart/alternative ]


Simon, thank you.  This started me..err.. my friend in the right direction.
 Then a quick trip to the midrange archives with better search words and we
found Jon Paris' answer to a similar situation, and it all came together
wonderfully.

(David, as usual, this list rulz! thanks)



---------------------------------------------------------
Booth Martin   http://www.MartinVT.com
Booth@MartinVT.com
---------------------------------------------------------

-------Original Message-------

From: rpg400-l@midrange.com
Date: Monday, August 19, 2002 02:09:20
To: rpg400-l@midrange.com
Subject: Re: filling arrays from a record

Hello Booth,

You wrote on behalf of "A Friend" :-)

>I have an indexed file with several records in it. Each record contains

>the data for 3 15-element arrays. the arrays are 7/0, 8/2, & 4/2. The

>fields in the record match that description and are placed by elements,

>i.e. element 1,1,1 2,2,2 3,3,3 4,4,4 ,,,,, 15,15,15


If I understand correctly you have a file like:

A A1 7P 0
A B1 8P 2
A C1 4P 2
A A2 7P 0
A B2 8P 2
A C2 4P 2

and so on.

>What is the best way to load those 3 arrays?


As always it depends but I would take the straightforward approach:

D A_ELEM S 7P 0
D B_ELEM S 8P 2
D C_ELEM S 4P 2

D A_DS DS
D A1 LIKE(A_ELEM)
D A2 LIKE(A_ELEM)
D A3 LIKE(A_ELEM)
.......
D A LIKE(A_ELEM) DIM(15)
D OVERLAY(A_DS)

D B_DS DS
D B1 LIKE(B_ELEM)
D B2 LIKE(B_ELEM)
D B3 LIKE(B_ELEM)
.......
D B LIKE(B_ELEM) DIM(15)
D OVERLAY(B_DS)

and so on. Your friend and his colleagues should have no difficulty
understanding what is happening.

>The arrays will be re-loaded at every level break.


Not sure why that would matter.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software AS/400 Technical Specialists
http://www.flybynight.com.au/

Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\
Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
--
[ Content of type image/gif deleted ]
--



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.