IB Statements/clearfile

From CometWiki

< IB Statements(Difference between revisions)
Jump to: navigation, search
m (clarification)
 
Line 7: Line 7:
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 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.  
+
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.   
'''History:'''  This feature was added to CometServe32 and CometServeNLM Version 2.59.   

Latest revision as of 20:59, 1 June 2010

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