[Info-vax] Cobol: Faster flushing of buffer to sequential file
Richard Maher
maher_rj at hotspamnotmail.com
Fri Feb 4 21:31:14 EST 2011
Hi George,
"George Cornelius" <cornelius at eisner.decus.org> wrote in message
news:VPZiYpBAIAnc at eisner.encompasserve.org...
> In article <ihno8t$e9k$1 at speranza.aioe.org>, "Richard Maher"
> <maher_rj at hotspamnotmail.com> writes:
>> Having said that, I knocked up this quick example to test and, you're
>> right,
>> it doesn't achieve the OP's desired results: -
>
> I wrote a cobol program once, a few pages of code into a spiral notebook,
> and it remains there to this day - I suppose 40 years later.
>
> But I was curious, Richard, to try your program with $ CONVERT/SHARE, so
> below are the results.
>
>> On a flush, the EOF value written to the file header is only accessible
>> to
>> subsequent accessors. Any process that has the file open at the time of
>> the
>> flush cannot access the new EOF value without some explicit action.
>
> This works, but only recognizes it after the close statement in MAHER.COB
> .
>
> $ TYPE/CONTINUOUS/INTERVAL=seconds
>
> George Cornelius
>
> -----------------------------------------------------------------------------
>
> [MAHER.EXE is sitting at the input prompt in another window]
>
> GFC_EISNER> sho sym srl ! An RSX-ish lister
> SRL == "DIRECTORY/SIZE/DATE/WIDTH=FILE:45"
> GFC_EISNER> srl/sin
>
> Directory USR_SCRATCH:[CORNELIUS]
>
> MAHER.COB;2 12 4-FEB-2011
> 18:48:19.02
> MAHER.COB;1 12 4-FEB-2011
> 18:45:40.05
> MAHER.EXE;1 17 4-FEB-2011
> 18:48:46.53
> MAHER.LIS;1 24 4-FEB-2011
> 18:48:39.94
> MAHER.MAP;1 12 4-FEB-2011
> 18:48:46.51
> MAHER.OBJ;1 12 4-FEB-2011
> 18:48:39.94
> MY_FILE.DAT;1 0 4-FEB-2011
> 18:49:17.16
>
> [...]
>
> GFC_EISNER> conv/share my_file.dat sys$output:
> GFC_EISNER> conv/share my_file.dat his_file.lis /stat
>
> CONVERT Statistics
> Number of Files Processed: 1
> Total Records Processed: 0 Buffered I/O Count: 11
> Total Exception Records: 0 Direct I/O Count: 5
> Total Valid Records: 0 Page Faults: 22
> Elapsed Time: 0 00:00:00.01 CPU Time: 0 00:00:00.01
> GFC_EISNER> type his_file.lis
>
> -----------------------------------------------------------------------------
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)
The consensus and all supporting evidence is that either a $flush or close
of the file is required to force the data to be written thru to disk.
We are where we appear to be.
Cheers Richard Maher
PS. I still believe RMS has some other incantation but no one here knows or
is interested in sharing. (Or I'm just talking crap :-)
More information about the Info-vax
mailing list