OpenVMS DCL EXITSTATUS: Non-Search Path Logical Names

Often, user questions bring into focus interesting ways to use standard OpenVMS facilities. In a thread entitled “how to DCL custom exit?” on Hewlett Packard's ITRC OpenVMS Forum, Claus Olesen inquired, among other things how one could EXIT a DCL procedure using the name of a standard OpenVMS status code, rather than an actual numeric value.

This question provides for an opportunity to use several OpenVMS features in concert to address a problem that is often, at best, an annoyance. Indeed, OpenVMS has an extensive repetoire of such codes (857 as of OpenVMS Alpha Version 7.3-2). While developers and maintainers often recognize commonly used codes, remembering the numeric values for less-commonly used codes is an inconvenience.

%SYSTEM-W-NOSUCHFILE, no such file
$STATUS == "%X00000910"

EXITSTATUS uses the OpenVMS logical name facilities together with the lexical functions and string substitution features of DCL to provide a tools for developers and maintainers to symbolically return error codes from DCL procedures.

The cost of this is negligible, a handful of bytes of pageable pool. No additional overhead is added to normal logical name lookups, as the logical name table defined for this purpose is not included in the normal logical name lookups done by either RMS or by the $TRNLNM system service.

This implementation consists of two command procedures:

EXITSTATUS_STARTUP.COM can be run by an individual non-privileged user for their own job or process, on a group basis, or by the system manager at system startup for the entire community.

Download EXITSTATUS (OpenVMS ZIP Archive)

Picture of Robert Gezelter, CDP
Bringing Details into Focus, Focused Innovation, Focused Solutions
+1 (718) 463 1079