Jim writes:
> In addition to the SHR;GMULTI Stan specified, I'd add LOCK and then use t=
> he
> EXCLUSIVE/
> UN-EXCLUSIVE verbs in the COBOL program(s) to logically lock the file whe=
> n
> writing =
The problem with this is that if the file is large (let's say, 1 MB or more),
the UNLOCK operation will kill your performance. In general, there's
little reason to lock the file unless either of the following is true:
1) a single process sometimes wants to append multiple records, and they
should be contiguous in the file;
2) a reader process wants to say "how many records are there", and then
"go get them". ... but even that doesn't require locking.
> to it. I'd also add the FILE STATUS clause to the SELECT statement and
> interrogate =
> the file status after each I/O operation (OPEN/EXCLUSIVE/WRITE/...). We =
Excellent suggestion!
--
Stan Sieler [log in to unmask]http://www.allegro.com/sieler.html