I have done this before (several years ago), and this isn't the best solution I'm sure & involves some overhead. I simply calculated the location by using the indexes. I think I did it similar to this:
For 3 dimensions: x, y, z
Example: let's say you have 3 tables, each with 8 x 10, for a total of 240 elements. Using x,y & z as your indexes, to find the element you would compute the index as:
Eval Idx = (Xsiz * (x - 1)) + (ysiz * (y - 1))
+ (z)
Element 2, 3, 4 would be (80 * (2 - 1)) = 80
+ (10 * (3 - 1)) = 20
+ 4
= 104
Your value(s) are stored in element 104. You can easily add dimensions by changing the calculations. Remember that you are limited to 32766 elements per array. You could also compute the RRN of a record in a file, if you need more workspace.
There is a series of articles on the news/400 website (May 1998 & May 1999 if you get the printed copy) specifically about simulating multi-dimensional arrays - I'm sure those are much more sophisticated than my approach. It requires that you have a paid subscription.
Hope it helps.
Ken Hood