Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 
Hierarchical set of data which i would like to store in 2D

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jagjit

New User


Joined: 28 Dec 2006
Posts: 18
Location: india

PostPosted: Wed Apr 18, 2007 2:45 pm    Post subject: Hierarchical set of data which i would like to store in 2D
Reply with quote

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
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 3:00 pm    Post subject:
Reply with quote

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
View user's profile Send private message
jagjit

New User


Joined: 28 Dec 2006
Posts: 18
Location: india

PostPosted: Wed Apr 18, 2007 3:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Wed Apr 18, 2007 3:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 4 Wed Aug 23, 2017 9:59 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts copying data without knowing location Arun Raj DFSORT/ICETOOL 12 Thu Jul 20, 2017 1:03 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us