Retrieval of data

The user can retrieve Zebra data structures from any directory on a disk file into memory through the routine CDUSE. The data objects are selected according to the given directory pathname and to the contents of the key vector. Selection is made on the pairs of validity ranges and on the specific user keys selected, if any. If not yet done, the routine creates in memory a tree structure of NODE banks, according to the pathname elements. At the lowest node, CDUSE inserts the information relevant to the keys in KEY banks (one or several, created as a linear chain at the next-of-same-type link of the corresponding NODE banks) and the information relevant to the data itself, in DATA banks supported by the first link of the corresponding KEY banks. As a general rule, when CDUSE finds that more than one data object satisfy the validity criteria, the default action is to return the most recently inserted object that matches the selection criteria. Special actions can however be taken, by using the mask IMASK to select on values of system or standard user keys, such as the source identifier or insertion time, or indeed any of the normal user keys. If any element n of the vector IMASK is set, then only objects with this key element equal to the corresponding element of the input key vector will be selected. In the special case of the key pairs, setting this element will select only objects with start validity less than, or end validity greater than, the corresponding value specified in the input selection vector ISEL. This permits selection of all objects valid before or after a given run, event or time, depending on the key pair definitions.

Independently, the user can set a global selection on insertion time, through the routine CDBE4, for instance to ignore modifications to the data base past a certain date and be able to reproduce the conditions of a previous program execution.

In some special cases, one may wish to retrieve all valid objects that satisfy the specified selection criteria, and not just the most recently inserted one. In this case, or if one wishes to make multiple selections in a single call, the routine CDUSEM should be used.

With the option 'K' (key), CDUSE also permits retrieval of the keys only, without loading the data objects.

In case CDUSE finds that the required data objects already exist in memory, it does not bother to transfer them again from disk.

For an optimum use of the memory, and in order to minimize the disk accesses, the user should call the routine CDFREE, in conjunction with CDUSE. CDFREE sets a flag in the specified KEY bank to signal that the corresponding data object is no longer needed, until a subsequent call to CDUSE requires it again. The data object bank is not dropped immediately, but only if and when any other call to CDUSE need more space than currently available in memory. If the 'frozen' data object has not been dropped when it is required again, the flag is cleared and no further disk transfer will take place.

To read data objects where ASCII information has been encoded, the user can call CDTEXT, similar to CDUSE, except that the logical unit number of the file reserved to write the ASCII information has to be passed as an argument.

Simple Fortran vectors may be stored and retrieved using the routine CDVECT.