HP3000-L Archives

November 1999, 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:
Tony Summers <[log in to unmask]>
Reply To:
Tony Summers <[log in to unmask]>
Date:
Thu, 4 Nov 1999 10:49:53 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (68 lines)
Read next record restriction.

I agree with Costas - if you're planning to use Ksam in any big way and 
need this restriction then do what we do - we've canned all our Ksam 
calls into a database handler and we have a several flavours of "read 
next record". 

Whilst I'm replying - please be aware of the following gotcha in Ksam which was
true for CM ksam (and I believe still applies to NM ksam). 

If you're reading down a ksam file whilst someone else is updating that file
then it is quite possible for the reading application to either miss records or even get 
several records twice.  The problem lies in how ksam manages its key pointers - the 
manual blandly warns you to FLOCK around all your FREADS - but in reality this isn't
possible - for example you might want to read and display 30 records to your user, then
pause and then show another 30 records.  

Again, to get round this problem we've used our Ksam database handler.

P.S. Can anyone remind me whether this is the same as a broken chain in Image ? 

>>> Costas Anastassiades <[log in to unmask]> 04/11/99 10:52:55 >>>
Well you can't limit it through the use of intrinsics. Use FFINDBYKEY to
point to the first record (using a relational operator of equal). After
each FREAD compare the value you just read to the key value you
specified for FFINDBYKEY (and stop FREADing when it changes).


>>> Costas Anastassiades <[log in to unmask]> 04/11/99 10:52:55 >>>
Well you can't limit it through the use of intrinsics. Use FFINDBYKEY to
point to the first record (using a relational operator of equal). After
each FREAD compare the value you just read to the key value you
specified for FFINDBYKEY (and stop FREADing when it changes).

Costas Anastassiades,
Intracom SA
Athens-Greece

-----Original Message-----
From: Eben Yong <[log in to unmask]>
To: [log in to unmask] <[log in to unmask]>
Date: Thursday, November 04, 1999 7:07 AM
Subject: KSAMXL question


>I am trying to set up a COBOL program that reads records in a KSAMXL
file
>based on an exact match to a key value.  The file can contain multiple
>records based on the key value.  I only want to read those records that
>match the key value exactly.  I have been able to successfully find and
read
>the first record using FREADBYKEY and FFINDBYKEY+FREAD, but then
subsequent
>FREADs will take the rest of the KSAMXL file until it hits EOF.  How do
I
>limit the FREAD so that it only reads the qualifying logical records
(based
>on the key value)?  If someone could provide the intrinsic sequence and
>logic I can figure out the programming details.  Thank you for your
>assistance.
>
>Eben Yong
>MIS Manager
>Health Plan of San Mateo
>650-616-2010
>[log in to unmask] 
>

ATOM RSS1 RSS2