FLUSH

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 statement is used to ensure that all disk I/O on file f has been written to disk. This statement must be used 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); 
FLUSH(MYFILE);

Restrictions

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