Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Flatten out a hierarchy?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Fri Jan 25, 2008 1:38 pm    Post subject: Flatten out a hierarchy?
Reply with quote

Hi Experts!

I have an exciting task for you... icon_razz.gif I have a hierarchy structure in a database unloaded to a dataset. The data has the following layout:

ID1ID2
ID1ID3
ID3ID6
ID2ID4
ID4ID5
etc

...where the leftmost ID is the parent of the rightmost each ID. So, the top of each hierarchy is defined as an ID not present in the rightmost side, ie. the ID only has parent relations. There can be max. 9 levels in the hierarchy, and each ID is defined as ZD 20. Each ID can only be present in ONE hierarchy structure.

My requirement for output is a flat version of the hierarchy, meaning I need one record per top point of each hierarchy, including all the IDs that belongs to it. In the example given, the output would be:

ID1ID2ID3ID6
ID2ID4ID5

Any help appreciated! icon_wink.gif
Back to top
View user's profile Send private message

Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Fri Jan 25, 2008 3:11 pm    Post subject:
Reply with quote

On second thoughts... I'd prefer the output this way:

For each hierarchy a unique (sequence) number followed by the each ID. So for the input shown:

0000001ID1
0000001ID2
0000001ID3
0000001ID6
0000002ID2
0000002ID4
0000002ID5

One importent remark on the input: It's not ordered so that each hierarchy is grouped together.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Generate - Hierarchy of the Outpu... GAPX1 COBOL Programming 1 Tue Jul 28, 2015 2:13 am
No new posts what is the hierarchy of a cobol prog... nandeshwar COBOL Programming 9 Mon Nov 29, 2010 2:48 pm
No new posts DB2 Query to get the Hierarchy gayathrinag DB2 3 Tue Nov 17, 2009 12:14 pm
No new posts Retrieving only one side of hierarchy km_abdullah IMS DB/DC 7 Tue Dec 16, 2008 11:54 am
No new posts Finding the hierarchy of function calls. srajendran CLIST & REXX 2 Tue Jul 31, 2007 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us