[Info-vax] Cobol: Faster flushing of buffer to sequential file
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Sat Feb 5 09:22:30 EST 2011
In article <941ea11d-36c0-4110-9d8f-6d3b2d6fc323 at x1g2000yqb.googlegroups.com>, Hein RMS van den Heuvel <heinvandenheuvel at gmail.com> writes:
>On Feb 4, 9:31=A0pm, "Richard Maher" <maher... at hotspamnotmail.com>
>wrote:
>> "George Cornelius" <cornel... at eisner.decus.org> wrote in message
>
>> > GFC_EISNER> conv/share my_file.dat his_file.lis /stat
>:
>> > Total Records Processed: =A0 =A0 =A0 =A0 =A0 0 =A0 =A0Buffered I/O Coun=
>t: =A0 =A0 =A0 =A0 =A0 11
>:
>
>I was wrong about the CONVERT/SHARE.
>I forgot that CONVERT uses UPI sharing
>In an attempt to optimize (reduce locks) it overshoots its 'raison
>d'etre' : get the data.
>
>
>> > GFC_EISNER> type his_file.lis
>>
>> > -----------------------------------------------------------------------=
>---- --
>:
>> The consensus and all supporting evidence is that either a $flush or clos=
>e
>> of the file is required to force the data to be written thru to disk.
>
>Practically YES: Consensus. And Flush needed.
>Technically NO: The data IS written tot the disk.
>It's just that mere mortals can not see it there.
>So practically it ain't there :-).
>
>Still, Technically the write IO _is_ done all the way through to the
>disk.
>And the EOF _is_ updated ... in the RMS Shared File Lock Value Block,
>just not on disk.
>
>This van be verified in many ways.
>
>1) RMS file statistics
>
>2) LD driver IO traces
>
>3) ANALYZE/SYSTEM ... SHOW PROC/RMS=3DBDBSUM ( buffer VALID, not DIRTY
>not IO in PROGRESS)
>
>My favorite method:
>
>4) $ dump/head/bloc=3Dcount=3D1/width=3D80/ALLOCATED my_file.dat
>:
> End of file block: 1
> End of file byte: 0
>:
> Retrieval pointers
> Count: 6 LBN: 15913410
>:
>Virtual block number 1 (00000001), 512 (0200) bytes
>
> 20202020 20202065 67617373 656D2041 A message 000000
>:
>
>> 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 :-)
>
>That would be to use the official method to read the file.
>
>5) The reader opens the file with full sharing.
>
>Below the signature a dinky example program to do just that which I
>happened to have posted earlier this week in:
>http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=3D146=
>6976
>
>Clear as mud?
>Hein
>
Is the quoted-pukeable crap due to posting through Google Groups?
Or, due to what you use to post there?
>$ type MAILBOX_TO_FILE.MAR
> .psect data, wrt, noexe
>buf: .blkb 32*1024
>infab: $FAB fnm=3Dmailbox_input,dnm=3Dsys$login:.dat,fac=3Dget,shr=3Dput
-----------------^^^-----------------^^^------------------^^^-------^^^
>inrab: $RAB fab=3Dinfab,usz=3D32000,ubf=3Dbuf
-----------------^^^---------^^^---------^^^
>outfab: $FAB fnm=3Dlog_output,dnm=3Dsys
-----------------^^^--------------^^^
>$login:.log,fac=3Dput,shr=3Dput,fop=3Ddfw,rat=3Dcr
-----------------^^^------^^^-------^^^-------^^^
>outrab: $RAB fab=3Doutfab,rbf=3Dbuf
-----------------^^^----------^^^
>
> .psect code, nowrt, exe
> .entry start,0
> $OPEN fab=3Dinfab
------------------^^^
> blbc r0,error
> $CREATE fab=3Doutfab
--------------------^^^
> blbc r0,error
> $CONNECT rab=3Dinrab
---------------------^^^
> blbc r0,error
> $CONNECT rab=3Doutrab
---------------------^^^
Why not just $CREATE and CIF?
> blbc r0,error
>loop:
> $GET rab=3Dinrab
--------------------^^^
> blbc r0,end
> movw inrab+rab$w_rsz, outrab+rab$w_rsz
> $PUT rab=3Doutrab
--------------------^^^
> blbc r0,error
> brw loop
>end:
> cmpl r0,#RMS$_EOF
> beql succes
>error: ret
>succes:
> movl #1, r0
> ret
> .end start
>$ mac MAILBOX_TO_FILE.MAR
>$ lin MAILBOX_TO_FILE
>$ run MAILBOX_TO_FILE
>A message
>$
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
All your spirit rack abuses, come to haunt you back by day.
All your Byzantine excuses, given time, given you away.
More information about the Info-vax
mailing list