Date: Wed, 11 Dec 2002 17:00:06 -0500
Reply-To: Howard_Schreier@ITA.DOC.GOV
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Howard_Schreier@ITA.DOC.GOV
Subject: Re: Parent/Child relationships
What does "!" signify? Why does LLLLLLLL's line not have "-- " after "+"?
I'll ignore these issues for now.
A few ideas.
Use @"+-- " pointer control along with INFILE's COLUMN= option to position
the pointer and detect indentation level. First generation (unindented)
lines won't hit, but I think if MISSOVER is in effect pointer will end up at
column 1, which is appropriate. Or will it end up at the high end? If so,
comparison with a variable loaded by the LENGTH= option should permit
detection.
Have a RETAINED variable to remember the previous line's indentation level
and a RETAINED array to remember the current ancestry sequence at all times.
When indentation drops back (as between HHHHHHHH and IIIIIIII), make
appropriate "erasures" in the array.
That should deliver the information needed to identify the parent for each
record as it is processed.
On Wed, 11 Dec 2002 09:34:40 +0100, Alex Benny Nielsen <albni@TDC.DK> wrote:
>I am trying to build a parent/child relationship from a "flat" file looking
>like this :
>< AAAAAAAA
>
>< +-- BBBBBBBB
>
>< +-- CCCCCCCC
>
>< +-- DDDDDDDD
>
>< ! +-- EEEEEEEE
>
>< ! +-- FFFFFFFF
>
>< ! +-- GGGGGGGG
>
>< ! +-- HHHHHHHH
>
>< +-- IIIIIIII
>
>< +-- JJJJJJJJ
>< +--KKKKKKKK
>< +LLLLLLLL
>
>for input to either proc netdraw or treeview.
>Any ideas.
>This is just an example.There could be many more levels.
>
>Regards
>Alex B. Nielsen
>TDC Services A/S
>Operation Management
>Copenhagen,Denmark
>* E-mail : mailto:albni@tdc.dk