RPG Free Array Processing Problem

75 pts.
Tags:
iSeries
RPG arrays
RPG ILE
V5R4
If you've seen this question before it's because when I add my code and submit and view it, it is unreadable. I'm trying to get a "clean" representation of my question. Thanks for your patience.

I have loaded a data structure from a database file with three 3 byte fields, i.e. 100101102. It loads into the array just fine. Now, I want to pick the first element of the array and process it's content, then the second element and the third. Currently, Im attempting to load the first element into a 3 byte standalone field with the %subarr BIF and I get the message (Array has too many omitted indexes) when compiling. Someone in another forum, different problem, said the receiver value must be a %subarr also. Does anyone have any examples of something like this?

Thanks in advance.

Below is my code:

Fmaster if e k disk

 

Dx s 3u 0

Dy s 3u 0

Ditmtype s 3a

Darr1 s 9 dim(1000)

 

Dtypes ds

D type1 3a

D type2 3a

D type3 3a

 

/free

x = 1;

read master;

dow NOT %eof(master) and x <= 600;

arr1 = types;

dow x <= 3;

itmtype = %subarr(arr1:x:3);

x = x + 1;

enddo;

read master;

enddo;

 

*inlr = *on;

 

/end-free

The array loads just the way I want it.



Software/Hardware used:
RPG ILE,iSeries,V5R4

Answer Wiki

Thanks. We'll let you know when a new response is added.

Please see responses to earlier copies of this question — <a href=”http://itknowledgeexchange.techtarget.com/itanswers/rpg-free-array-processing/”>RPG Free Array Processing</a>. If the problem isn’t resolved, please continue the discussion in that question.

Tom

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following