CLEAR-FILE
Deletes all items (except D-pointers) currently stored in a specified dictionary or data section.
Command class
TCL-I command.
Syntax
CLEAR-FILE file-specifier
Syntax elements
file-specifier Specifies the file to be cleared, according to general conventions.
For a normal file, if the DICT file modifier is included, only the dictionary is cleared; otherwise, only the data section is cleared.
For a hyper file, all hyper sections are cleared.
Restrictions
SYS1 privileges are requested to execute CLEAR-FILE.
You cannot clear an encrypted file unless your security profile gives you access to the encryption key.
Comments
After clearing the file, the disk space originally allocated when the file was created is retained. See also DELETE-FILE.
If DICT is specified, all items such as data definition items are deleted from the dictionary file, but not the data level descriptors. They are retained to point to the data sections.
Caution
Ensure that no users are using a file before clearing it; otherwise, you risk causing problems with read and update lock codes that might be in use. Do not use a file with GFEs.
When a data section that is configured for automatic file sizing is cleared, it is normally contracted to its initial modulo. However, if the current modulo is less than its initial value, the modulo is left unchanged.