[Info-vax] Cobol: Faster flushing of buffer to sequential file
George Cornelius
cornelius at eisner.decus.org
Mon Feb 7 14:11:10 EST 2011
In article <iiicpm$gaf$1 at speranza.aioe.org>, "Richard Maher" <maher_rj at hotspamnotmail.com> writes:
> I might have missed something in your post but am I correct in understanding
> it to have confirmed the fail case? (i.e. yes, no one else can see the
> record until it has been flushed or the file closed)
Sorry, Richard, I guess I was a bit terse in my posts.
Yes, your program as written, as Hein has remarked, does
not do anything to update the EOF pointer in the file
header. Looks as if it takes SYS$FLUSH or a close to do
that. And apparently $ CONVERT/SHARE does not use strong
enough voodoo (FAB$M_UPD in FAB$B_SHR) to get past that.
But, I was taken by surprise when a simple
$ OPEN/READ/WRITE/SHARE from DCL could not only access
all data you had written, but, after a $ CLOSE
operation, make it available to other readers as
well.
So a SYS$FLUSH or CLOSE is needed to cause the header
to be updated, but an external program can do it.
Thus, all three options for changing the app work -
OPEN,WRITE,CLOSE; OPEN ALLOWING ALL; and SYS$FLUSH -
but the second requires a reader program that uses
the correct sharing semantics, or at least some
DCL in the background that periodically opens for
shared write and then immediately closes again.
George
More information about the Info-vax
mailing list