Date: Wed, 11 Dec 2002 17:00:06 -0500
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
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
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 :
>< +-- BBBBBBBB
>< +-- CCCCCCCC
>< +-- DDDDDDDD
>< ! +-- EEEEEEEE
>< ! +-- FFFFFFFF
>< ! +-- GGGGGGGG
>< ! +-- HHHHHHHH
>< +-- IIIIIIII
>< +-- JJJJJJJJ
>for input to either proc netdraw or treeview.
>This is just an example.There could be many more levels.
>Alex B. Nielsen
>TDC Services A/S
>* E-mail : mailto:firstname.lastname@example.org