[Info-vax] Cobol: Faster flushing of buffer to sequential file
Neil Rieck
n.rieck at sympatico.ca
Sat Feb 5 09:50:19 EST 2011
On Jan 13, 1:03 pm, snake <ythe... at gmail.com> wrote:
> Hi,
>
> I got a Cobol program that writes some output to a sequential file.
> This output is very minimal, and the program can run for several
> hours.
> Is there a way that the buffer is flushed faster to the sequential
> file?
>
> I assume there is some compiler/link flag that I can set to achieve
> this, but I can't find it...
>
> Thanks in advance,
> Y
I have never used COBOL since leaving school so take the next bit of
advice with a grain of salt.
In HP-BASIC for OpenVMS, if you open an RMS file without using the
keyword ALLOW then it will default to ALLOW NONE. What this means is
your writing process wont flush the buffer to disk until:
1) you CLOSE the file -OR-
2) or the write buffer becomes 100%
Changing the open statement to either ALLOW READ or ALLOW MODIFY
causes write data to flush to disk immediately. You can prove this by
also comparing to ALLOW NONE then kill the writing process before it
can issue CLOSE (ALLOW NONE will often return a blank file which means
that nothing was written to disk)
###
So I downloaded the three COBOL manuals from here:
http://h71000.www7.hp.com/doc/cobol.html
In the COBOL USER MANUAL as well as the COBOL REFERENCE MANUAL there
appear to be references to an HP extension to OPEN called ALLOWING
(ALLOWING READERS, ALLOWING WRITERS, ALLOWING ALL). Maybe these
clauses will do for you in COBOL what BASIC did for me.
Good hacking!
Neil Rieck
Kitchener / Waterloo / Cambridge,
Ontario, Canada.
http://www3.sympatico.ca/n.rieck/
More information about the Info-vax
mailing list