Once you have finished using a file, CLOSE can be used to release the channel to which it is attached, so that the channel is available for use with some other file. Parameters CHANNEL and FILETYPE indicate the channel number and the type of file, as in the OPEN directive. The DELETE parameter is useful if you are using files to store data temporarily, perhaps to release workspace within GenStat. When you have finished with the file you can set DELETE=yes to request that it be deleted on closure so that disk space is not wasted. For example,
OPEN 'temp.bin'; CHANNEL=3; FILETYPE=unformatted
PRINT [CHANNEL=3;UNFORMATTED=yes] \
"... and later on when you wish to retrieve the data ..."
READ [CHANNEL=3;UNFORMATTED=yes] \
CLOSE 3; FILETYPE=unformatted; DELETE=yes
You cannot close a channel to which the keyboard or screen are attached, nor the current input or output channels. Also you cannot use CLOSE to delete files that have been opened with ACCESS=readonly or that are protected by the computer's file system. However, you do not need to close every file before you stop running GenStat; files are automatically closed at the end of every GenStat program.
Parameters: CHANNEL, FILETYPE, DELETE.
Directives: OPEN, ENQUIRE.