Normally, when a foreign format dataset is converted to or from the native NDF format, the native copy of the data will be held in temporary file space (it will usually be written to a data structure held in the standard HDS scratch file), and this copy will be deleted when no longer required. Normally, this occurs when the dataset is released by the application.
Sometimes, however, it may be more convenient to retain the converted copy. For example, if you have foreign format data but plan to run several NDF-based applications on it, then retaining the native NDF copy the first time it is converted will save you having to re-convert the data on subsequent occasions.
To do this, the NDF library `KEEP' tuning parameter should be set to 1. This can be done by calling the NDF_TUNE routine from within an application, but can also be done by setting the environment variable NDF_KEEP to `1' outside the application (see SUN/33), for example:
setenv NDF_KEEP 1
If this is done, then subsequent access to a foreign format dataset (say galaxy.fit) will create a corresponding native format NDF copy of the data in the default directory (in this case in a file called galaxy.sdf). This will be retained, and will then be accessed the next time galaxy is specified as a dataset name (remember, if no file extension is given, there is always an implicit search for a native format dataset before looking for a foreign one).
The `KEEP' tuning parameter may be changed at any time, so control over individual datasets is possible if it is set from within an application. The value used will be that in effect when the dataset is first accessed.