[Info-vax] Cobol: Faster flushing of buffer to sequential file
Neil Rieck
n.rieck at sympatico.ca
Sun Feb 6 07:22:24 EST 2011
On Feb 5, 10:28 am, Hein RMS van den Heuvel
<heinvandenheu... at gmail.com> wrote:
> On Feb 5, 9:50 am, Neil Rieck <n.ri... at sympatico.ca> wrote:
>
> > On Jan 13, 1:03 pm, snake <ythe... at gmail.com> wrote:
> > I have never used COBOL since leaving school so take the next bit of
>
> This has little or nothing to do with Cobol/Basic/Fortran and
> everything with RMS
> Actually, with Cobol and C, an un-shared simple sequential file will
> be handled in the Language RTL.
> As such few(er) SYS$WRITE(s) will be used versus a SYS$PUT per record
> with the CMEXEC and RMS rab/rab checking that entails.
> That is typically a CPU win.
> The price is that RMS has not 'seen' the data yet, and STOP/ID
> ($DELPRC) will not be able to flush out dirty buffers/
> STOP/IMAGE ($FORCEX) will trigger RTL rundown which will flush out
> best it can.
>
> Btw... still using Richard;s example but modified to OPEN OUTPUT
> MY_FILE, to test the above the force exit creates an 'interesting'
> error:
>
> Hit <return> to continue. . .
> %COB-F-CLOSE_ERROR, unknown error during CLOSE SYS$INPUT:.;
> -RMS-E-ACT, file activity precludes operation
> %TRACE-F-TRACEBACK, symbolic stack dump follows
> :
>
> > 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% (full)
>
> right
>
>
>
> > Changing the open statement to either ALLOW READ or ALLOW MODIFY
> > causes write data to flush to disk immediately.
>
> right, as I wrote earlier. I would not use the word flush when you
> mean write as it is 'overloaded'
>
> > (ALLOWING READERS, ALLOWING WRITERS, ALLOWING ALL). Maybe these
> > clauses will do for you in COBOL what BASIC did for me.
>
> Of course they do. That's all RMS.
>
> :-)
>
> Hein.
All 100% correct points. My point of view is this: the RMS options
(flush immediately vs. flush when buffer is full or close) have been
set by the language developers to best support the OPEN statement
options invoked by the application programmer. So just by changing the
OPEN statement you can get the desired results without too much
additional effort.
NSR
More information about the Info-vax
mailing list