HP3000-L Archives

August 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tracy Pierce <[log in to unmask]>
Reply To:
Tracy Pierce <[log in to unmask]>
Date:
Wed, 16 Aug 2000 08:56:56 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (240 lines)
Gentle listers, let me try again please; and sorry to pester, just tell me
to go away if I'm being too stubborn.  The question is, as succinctly as I
can describe it, is...

"Shouldn't I expect to get the last record when I do (BTREEMODE1=ON) DBFIND
mode 1 arg @ vs indexed-master followed by DBGET mode 6?".

First of all, let me apologize for putting words into the mouth of Stan
Sieler, who replied privately to an earlier private post to him "I just
tried it and it works" in the same breath as he acknowledged missing the
gyst of my original long-winded 'explanation' of my question.

Since it still doesn't work, at least for me, I posted to the list, and got
exactly one response, for which Thanks, Jerry, but I don't think I got the
question across yet.  Based on your "so what doesn't make sense?..." logic,
I should get an end-of-chain when I go forward, clearly not the case or the
desired result!

[It's never been my experience that KSAM would support doing this, in that
it's (at least described as) a single-threaded tree, that is it contains
pointers to the next record, but NOT the previous.  (which of course leaves
me wondering how backward can be reasonably supported at all).  Of course
the diagrams used in the discussion of KSAMXL are left over from the
original KSAM, so there may be enhancements internal to KSAMXL which enable
following the tree either direction.  And the fact that my experience
(pretty slim at this point) indicates that backward does work (at least for
a freshly built and unmodified index), and thus leads me to believe that it
should work all the time, including the first DBGET; also the TurboIMAGE/XL
(5.5) manual hints that it should work, that is it says "You can use DBGET
modes 5 & 6" with no disclaimers re 'initial' mode 6.

So it would not be unexpected to hear a resounding NO NO NO it can't be
done, but if NO is the answer, how can it work even AFTER mode 5?

The question is still open, at least for this feather-brain.

(I've attached my original off-list correspondence with Stan, way at the
end, in case that helps confuse or clarify.)

Thanks in advance,

K Tracy Pierce, Systems Programmer
Golden Gate Bridge, Hwy & Trnsp Dist
PO Box 9000, Presidio Station
San Francisco, CA  94129-0601
mailto:[log in to unmask]
415-923-2266

PS Wirt, thanks for stepping up to the (collection) plate.  Go A's!


> -----Original Message-----
> From: Jerry Fochtman [mailto:[log in to unmask]]
> Sent: Tuesday, August 15, 2000 11:56 AM
> To: Tracy Pierce; [log in to unmask]
> Subject: Re: [HP3000-L] Image B-Trees on MPE/iX 5.5 pp 7
>
>
> So what doesn't make sense?  Sure, you can do a backward read of a
> KSAMXL file (FINDN/FREAD). The DBGet error 14 makes sense in that
> you've established a chain of all entries(DBFIND, key @), so when
> reading this list of sorted entries backwards, one should expect to
> get 'beginning of chain', likewise 'end of chain' (DBGet error 15)
> reading forward (DBGET(5)).  Keep in mind that the DBFIND, mode 1,
> qualifier @ essentially established a logical chain of all master
> entries in sorted order.  And trying to read backwards when you're
> already pointing to the beginning of the logical chain (DBFIND,
> DBGET(6)) can't go backwards, hence the beginning of the chain error.
>
>  From what you've described, there doesn't appear to be any problem
> with how it is operating.
>
>
>
> At 11:22 AM 8/15/00 -0700, Tracy Pierce wrote:
> >I'm trying to use Image B-Trees to gain sequential access to
> my Image Master
> >sets.  I've done
> >:DBUTIL
> > >> SET VMSDB BTREEMODE1=ON
> > >> ADDIndex VMSDB FLEET-MASTER
> > >> ADDI VMSDB ACT-TYPES
> >and have changed a couple of programs to use DBGET mode 5 &
> 6 (instead of 2
> >& 3), and have changed the corresponding 'rewind' (DBCLOSE
> mode 3) to a
> >DBFIND mode 1 arg @.
> >
> >This seems to work, at least partially:  Using FLEET-MASTER
> as an example,
> >the DBFIND always works, and despite no record pointers it
> reports all 10
> >records on the dataset.  DBGET mode 5 yields the first
> ("smallest") record;
> >subsequent DBGET mode 5's yield increasing key values.  Once
> I've done a
> >DBGET mode 5, a subsequent DBGET mode 6 goes backward (how??
>  backward read
> >in KSAMXL file???).  But DBGET mode 6 immediately after the
> DBFIND just gets
> >me status 14, beginning of chain.  Kind of makes sense, but
> not enough; Stan
> >says it should work.
> >
> >Are there patches I've overlooked or something?
> >
> >:version dbutil.pub.sys
> >VERSION  C.55.00 Copyright (C) Hewlett-Packard 1987.  All
> Rights Reserved.
> >
> >DBUTIL.PUB.SYS
> >
> >SOM #1
> >$Header: nrt0.s,v 1.12 87/06/08 09:36:52 cary Exp $
> >Compiled on WED, SEP 24, 1997, 10:31 AM
> >S35S391C.HP30391.TURBONM
> >Copyright (c) 1987  Allegro Consultants, Inc.
> >SPLash! 97E 4.19
> >
> >t   the prior written consent of the Hewlett-Packard Company.
> >his program except for archival purposes is prohibited withou
> >d   in a retrieval system. Copying or other reproduction of t
> >me  and shall not otherwise be recorded, transmitted or store
> >987 This program may be used with one computer system at a ti
> >Compiled on THU, JUN  6, 1996,  7:33 PM
> >REDO.MODULE.TURBONM
> >Copyright (c) 1987  Allegro Consultants, Inc.
> >SPLash! 96E 4.10
> >
> >K Tracy Pierce, Systems Programmer
> >Golden Gate Bridge, Hwy & Trnsp Dist
> >PO Box 9000, Presidio Station
> >San Francisco, CA  94129-0601
> >mailto:[log in to unmask]
> >415-923-2266
>

Prior to posting to the HP3000-L, I had this exchange with Stan, which I
quite improperly quoted out of context.  Again, sorry, Stan...

Tracy wrote (and warning, this is the very long version, practically
designed to confuse)...
Stan,

Not sure whether to hit HP3000-L with this bandwidth, and knowing you'll be
the guy to answer anyway...

I'm starting to use Image B-trees, but am confused on (at least) one thing:
Assuming BTREEMODE1 is turned on, when I do dbfind mode 1 arg '@' vs indexed
master set followed by dbget mode 6, shouldn't I get the last record?

The details...
I have several apps in which the user is allowed 3 choices for entering a
key value for a master set:
1) enter a value, pgm does mode 7 dbget.
2) hit F1 ("next"), pgm does mode 2 dbget (forward serial)
3) hit F2 ("prev"), pgm does mode 3 dbget (backward serial) [yes i agree f1
f2 should be swapped, alas]
at the screen-read,
  If not db-ok
        if mode 7
                "no such record"
        else
                "rewind" (dbclose mode 3)
                if F1
                        dbget mode 2
                else
                        dbget mode 3
                end-if
                if not db-ok
                        "no records on file"
                end-if
        end-if
else
        display current record
end-if

This works just fine, and wraps around at beginning and end-of-file.  So,
now I want to use the B-tree indices to get these records in sorted sequence
instead of the 'random' results of serial master dataset access.  To do this
I turn on SET BTREEMODE1=ON via dbutil, then precede the screen read with a
dbfind mode 1  vs "@" in the master set. Now...
1) Enter a value, pgm does mode 7 dbget just like before.
2) Hit F1 ("next") pgm does dbget mode 5
3) Hit F2 ("prev") pgm does dbget mode 6
IF not db-ok
        if mode 7
                "no such record"
        else
                if  F1 or F2
                        dbfind mode 1 vs "@"
                        if  F1
                                dbget mode 5
                        else
                                dbget mode 6
                        endif
                        if  not db-ok
                                'no records on file'
                        end-if
                end-if
        end-if
else
        display current record
end-if

All seems lovely, almost.  If the user does F1 F1 F1 F1 F2 F2 F2, he sees
records A B C D C B A, leading me to believe that while the Image convention
of always supplying forward & backward record pointers for the current path
is not maintained, such pointers are maintained somewhere, as I can go
either direction up/down the chain.  Now at the next F2 we should and do get
db-status 14, beginning of chain.  But the sequence dbfind mode 1 "@" dbget
mode 6 gets me beginning of chain, too.  So backwards works, but not always?



So I guess my question amounts to How does this really work?  Has KSAMXL
been enhanced to maintain backward pointers?  Is there a way I can make the
'initial' mode 6 dbget work?

Thanks in advance


K Tracy Pierce, Systems Programmer
Golden Gate Bridge, Hwy & Trnsp Dist
PO Box 9000, Presidio Station
San Francisco, CA  94129-0601
mailto:[log in to unmask]
415-923-2266

To which Stan replied...
I'm probably missing something...your master dataset shouldn't have
multiple "A" or "B" or "C" records.
I.e.:  dbfind (mode 1, "@", on key of master) followed by
multiple DBGET 6 on the *master* should get the entries in the master
in reverse alphabetic order.  (I just tried it on a master where the
entries were in the order: J, A, E  ... and got back:   J, E, A.

--
Stan Sieler                                           [log in to unmask]

ATOM RSS1 RSS2