FLUSH Subroutine

Purpose

Open PL/I supports FLUSH as a built-in subroutine equivalent to the FLUSH statement.

Syntax

CALL 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.