[comp.os.vms] Files in FORTRAN; flushing output buffers

rankin@EQL.Caltech.EDU (Pat Rankin) (04/21/87)

  It is no longer necessary to resort to MACRO or USEROPEN routines
  in order to use SYS$FLUSH to flush RMS output buffers from Fortran.
  The run-time library contains a routine (FOR$RAB) that returns a
  pointer to the necessary RMS data structure. 

      INTEGER *4    rabadr,  FOR$RAB,  sts,  SYS$FLUSH
      ...
c   open the file for shared access
      OPEN ( lunit, SHARED, ...
c   get the address of the RMS Record Access Block
      rabadr = FOR$RAB( lunit)
      ...
c   add a record to the file--it will not show up yet if the I/O is buffered
      WRITE ( lunit, ...
c   flush the output buffer so that others can read our last record
      sts = SYS$FLUSH( %VAL(rabadr), , )        !2nd & 3rd args not used here
      ...
                                        Pat Rankin