View previous topic :: View next topic
|
Author |
Message |
jagjit
New User
Joined: 28 Dec 2006 Posts: 18 Location: india
|
|
|
|
hi,
i am having hierarchical set of data which i would like to store in 2D array . data is somewhat like this
Code: |
level-1 a(1,1)
level-2 b(2,1) c(2,2)
level-3 d(3,1) e(3,2) f(3,3) g(3,4) h(3,5) |
there can be n number of levels and maximum limit of no. of elements in level is 2000. Now i need to traverse from top to bottom and stores each data in 2D array using 3 loop at the max.
here a is parent of b and c
b is parent of d,e
c is parent of f,g and h |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Very pretty, not much sense, but interesting.
If you are asking if you can do that, the answer is yes.
If you are not asking that, what are you asking? |
|
Back to top |
|
|
jagjit
New User
Joined: 28 Dec 2006 Posts: 18 Location: india
|
|
|
|
i would like to develop an internal table in cobol for the same purpose. to add more it may happpen that few members at a particular level doesnot have children but other may continue to move down. the 2D array to be design can stores all member to any 'n' level. i need a help in designing loop for it in cobol. |
|
Back to top |
|
|
sandeep1dimri
New User
Joined: 30 Oct 2006 Posts: 76
|
|
|
|
need to look into tree data structure and then use the appropriate data type. yes this can also be done with two D array with defination like
my-array [n][2000]
initialize the array with default value and if this array can have all values then need to go for array like [n][2000][1]. |
|
Back to top |
|
|
|