HP3000-L Archives

November 2004, Week 1

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:
Brian Donaldson <[log in to unmask]>
Reply To:
Brian Donaldson <[log in to unmask]>
Date:
Thu, 4 Nov 2004 11:30:39 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (87 lines)
I started this posting as I wanted to find out a way of looking at
logically deleted records.

I wanted to ensure my app is deleting the
records it should be deleting and not whacking a bunch of records it
shouldn't be touching. I think my easiest solution for the time being is
putting displays in my program. That will help me.

So, I am assuming that I no longer need to reserve the first two bytes
of the record as a filler for the delete flag?

If I can remove the two byte filler from my app that should save on a quite
a bit of disc space.

Thanks to all who responded.

Brian.

On Wed, 3 Nov 2004 12:48:52 -0500, Cathlene Mc Rae <[log in to unmask]>
wrote:

>Deleting a Record
>
>From the ksamxl/ksam64 manual
>
>The intrinsic FREMOVE effectively removes the current record from the KSAM
>file. When executed, the 4-byte record header is modified, identifying the
>record as deleted. All key entries pointing to this record are deleted from
>the indexes. Although the data still occupies record space in the file, it
>is no longer possible to access the record through standard read
>operations. Note that if deleted record space can be reused, this area can
>be overwritten by a new record.
>
>The FREMOVE intrinsic checks only the logical record pointer, not the
>physical record pointer, to locate the record to be deleted. To delete a
>record located by its physical record pointer, precede the call to the
>FREMOVE intrinsic with the FPOINT intrinsic. The FPOINT intrinsic locates
>the record by its physical record pointer but sets both the logical and
>physical record pointers.
>
> If you use the FREADDIR or FREADC intrinsic to locate the record, only the
>physical record pointer is set. You may delete the wrong record because the
>logical record pointer was not set by the read procedure.
>
>
>Some additional information:
>NM KSAM built WO/ REUSE option - How to see deleted records
>
>With KSAM XL there is no way available to extract deleted records. KSAM XL
>keeps track of deleted records in a bit map (which is not avaliable to
MPE's
>FCOPY) as opposed to a -1 in the first two bytes on MPE V.
>
>If you need to read deleted records you will need to provide a field in the
>record that can be updated when a delete occurs.  Then do directed accesses
>against the file.
>
>KSAM will not tell a program if a retrieved record with directed access is
>deleted so you will need to check to see if the 'delete' field that was
>added to the record has been updated to deleted.
>
>You can use FREADDIR to read the data in chronological order.  This method
>willretrieve all records - including deleted ones.   It works with both
>versions of KSAM.   However, KSAM XL returns deleted records in a somewhat
>different format than CM KSAM.  With CM KSAM, a deleted record conains %
>177777 in the first word of the record.  With KSAM/XL, each data record
>contains an "in use" flag (bit 0:1) which, if set, means the record is
>currently active.  But this flag cannot be read by the user application.
>
>The "Using KSAM XL" manual's description of FREADDIR says: "If the record
is
>inactive, the contents of the inactive record are transmitted and a CCE is
>returned. (FCHECK returns a nonzero error number to distinguish active and
>inactive records.)"
>
>
>Hope this helps.
>
>Best Regards
>Cathlene Mc Rae
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2