FLUSH Subroutine

Purpose

Ensures that all disk I/O on a specified file has been written to disk, as opposed to remaining in I/O buffers.

Syntax

FLUSH(f);

Parameters

f is a filename.

Description

The FLUSH subroutine is used to ensure that all disk I/O on file f has been written to disk. This subroutine might be called in order to ensure some sort of synchronization, such as during critical I/O, or if there is a concern of a system crash or some other serious problem such that you may to want to make sure that the last I/O was in fact written out to disk.

Examples

DECLARE MYFILE FILE;

WRITE FILE(MYFILE) FROM(RECORD); 
CALL FLUSH(MYFILE);

Restrictions

  • Not valid for SYSPRINT or STDOUT files.
  • The asterisk used to flush all output files, for example call FLUSH(*), is not supported.