As has been illustrated earlier, HDS refers to data objects by means of values held in character variables called locators. Of course, these character values are not HDS data objects themselves; they simply identify the data objects, whose internal details are hidden within the HDS system.
Each locator has a unique value which will not be re-used, and this property makes it possible to tell at any time whether a character value is a valid HDS locator or not. A locator's validity depends on a number of things, such as its actual value (the value DAT__NOLOC6 is never valid for instance) and the previous history and current state of the HDS system (a locator which refers to a data object which has been deleted will no longer be valid). Note that locator values should not be explicitly altered by applications, as this may also cause them to become invalid.
Locator validity can be determined by using the routine DAT_VALID, which returns a logical value of .TRUE. via its VALID argument if the locator supplied is valid:
CALL DAT_VALID( LOC, VALID, STATUS )
This is the only HDS routine to which an invalid locator may be passed
without provoking an error.
HDS [1ex