*
In RPG you can set up a two dim array using the occurs clause. You have to fiddle about a bit because RPG doesn't support conventional 2 dimensional arrays. There are other ways of doing it but this is the way I always use.
Consider An Array:-
Col Col Col Col Col Col
1 2 3 4 5 6
Cost
Price
Cost
Price
Cost
Price
Cost
Price
Cost
Price
Code as:-
* Value Array By Column
DD1COLS DS OCCURS(6) INZ
D COST 20 3 DIM(5)
D PRICE 20 3 DIM(5)
*
.
.
.
*
* Set D1COLS Cost(3,2) to 50 and Price(3,2) to 100
3 OCCUR D1COLS
EVAL COST(2) = 50
EVAL PRICE(2) = 100
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.