[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: Fw: Index Descending?
From:       Dale McLerran <stringplayer_2 () YAHOO ! COM>
Date:       2003-07-31 23:45:59
[Download RAW message or body]

Kevin,

If index construction recognized an alternative collating
sequence, then it would not be necessary to construct the
pointers to traverse the index backward as well as forward,
at least if the index is formed on a character variable.
One could specify that the collating sequence should be
the reverse of the host-specific default.  Suppose that our
index were constructed for a character variable which took
on only letters in the alphabet.  When the index is constructed
on this variable, then the last letters of the alphabet would
appear first and the first letters of the alphabet would
appear last.  When the index is traversed from left to
right, the pointers would return observations in descending
alphabetic order.  No change in the pointer construction
would be necessary.  Perhaps you can correspond once more
with the birdie to suggest that the index construction
recognize the sortseq option.  That may not be as hard to
implement as would be the construction of bi-directional
pointers.

Dale


--- Kevin Myers <WHMyers@CABLEONE.NET> wrote:
> A birdie chirpeth:
>
> <snip>
> >Kevin, you say
> >
> >    There is no reason that you can't traverse
> >    an index backwards as well as forwards.
> >
> > If one designed, from the beginning, the data structures and code
> to move
> in
> > both directions, then what you say could be true. The SAS index
> code
> cannot
> > navigate backwards because it doesn't have all the necessary
> pointers. For
> > example, you can only travel from left (low values) to right (high
> values)
> > in the leaf nodes of the index tree. There are only left-to-right
> pointers.
> > Maintaining bi-directional pointers would be added overhead. Such
> an
> > enhancement would require a file format change.
> <snip>
>
> So, I guess it has been decided that the potential enhancement I
> described
> (traversing an index backwards for DESCENDING support in BY
> statements)
> would require too much effort for implementation considering the
> relative
> degree of need, and has been shelved for the immediately forseeable
> future.
>
> s/KAM
>
>
> > "Kevin Myers" <WHMyers@CABLEONE.NET> wrote in message
> > news:<00ae01c356f5$83e8bc70$67a8a8c0@speedy>...
> > > Please see below...
> > >
> > > ----- Original Message -----
> > > From: "Jack Hamilton" <JackHamilton@FIRSTHEALTH.COM>
> > > Newsgroups: bit.listserv.sas-l
> > > To: <SAS-L@LISTSERV.UGA.EDU>
> > > Sent: Wednesday, July 30, 2003 3:30 PM
> > > Subject: Re: Index Descending?
> > >
> > >
> > > > Syntactically, there's no way in SAS to request that a
> descending
> > > > index be created.  Neither the data set option INDEX= nor the
> SQL
> > > > statement CREATE INDEX accepts the DESCENDING keyword.
> > >
> > >
> > > Right Jack, I never suggested there was a way to create an index
> with
> > > values in descending order.  Nor do I necessarily think that
> there
> > > should be.
> > >
> > > I was hoping that BY statement processing might have been
> enhanced for
> > > V9.x to allow indexed values to be traversed in reverse order
> when the
> > > DESCENDING option is used.    Unfortunately, based on the
> > > info from Michael's latest post that enhancement doesn't seem to
> have
> > > been implemented (yet).
> > >
> > >
> >    [snip]
> >
> >
> >


=====
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@fhcrc.org
Ph:  (206) 667-2926
Fax: (206) 667-5977
---------------------------------------

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic