IB Statements/clearfile

From CometWiki

Jump to: navigation, search

CLEARFILE statement

Syntax: CLEARFILE (lun)

Discussion: The CLEARFILE statement clears all data from an open Comet data file.

The lun parameter is the numeric value that is assigned to the previously opened data file. The lun may be a numeric constant, numeric variable, or a symbolic constant. Its value may be from 0 through 99.

The CLEARFILE statement does not remove the data file entry from the Comet directory (like the ERASE statement does); it just clears all of the data records from the file.

CLEARFILE will clear the data from a file no matter whether other users have the file open. If exclusivity is desired, LOCK() the file.

History: This feature was added to CometServe32 and CometServeNLM Version 2.59.

Example: OPEN (20) "WORKFILE",DIR="DSK" . . . CLEARFILE (20) . . . CLOSE (20)

This example shows a data file named WORKFILE,DSK being opened on lun 20. The CLEARFILE statement clears all of the data from this file. At the end of the code segment, the file is closed.

Personal tools