Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two Dimensional Array

General

Two Dimensional Array

by  Skittle  Posted    (Edited  )
*
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


Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top