close statement

The close statement closes the file identified by file.var. If file.var is not specified, the file referenced by the default file.var is closed.


close {file.var}



Specifies the file to be closed.

Warning: For Windows: Copying file variables can be dangerous since a subsequent close on any of the file variables will close the file. Thus, any remaining file variables (containing a copy of the now invalid file handle) may be incorrectly allocated to the wrong file. 
root.var Specifies to close the parent file of an index that was opened using the root statement.


If used when the TCL set-remote-close command is set to on, the close statement also closes any associated remote files and releases any resources allocated to open files (such as memory and handles).

This statement must be used if a file is opened and then a delete-file is executed with an execute statement.

Files close by default when a program ends.

  • A file should be closed before it is deleted.

  • The close statement is not supported for files within transactions.

  • If set-remote-close is set to on, item locks and file locks associated with that file handle are released.


open ’testfile’ to testfile then
close testfile
execute ’delete-file testfile’
execute ’create-file testfile ’:newdictmod:’ ’:newdatamod