The FLUSH statement flushes the internal buffers for a directory file record previously opened for sequential access.
At least one of the THEN and ELSE clauses must be present. The THEN clause is executed if the operation is successful. The ELSE clause is executed if the FLUSH operation fails.
The sequential file buffers are automatically flushed periodically during file usage and on closing the file. The FLUSH statement allows the programmer to ensure that data is flushed to disk at a given point in the program
LINE = REMOVE(LIST, CODE)
WRITESEQ LINE TO SEQ.F ELSE ABORT "Write error"
FLUSH SEQ.F ELSE ABORT "Flush error"
This program fragment writes a series of text lines extracted from LIST to a sequential file and then flushes the buffers to verify that the data has been written to disk.