Table of Contents
Logical Names
The concept of a “logical name” is unique to VMS (OpenVMS) – no other operating system in common use has anything similar to VMS's logical names.
Introduction
In its simplest form and meaning, a logical name is nothing more than an alternate or alias name-string for another string-value. As an example, if we display the logical name SYS$ANNOUNCE
and its value string:
$ show logical sys$announce "SYS$ANNOUNCE" = " Welcome to OpenVMS (TM) IA64 Operating System, Version V8.4 " (LNM$SYSTEM_TABLE)
From this, we see several things:
- There is a logical name whose name-string is “
SYS$ANNOUNCE
”. - This logical name has an equivalence string (or value string) containing the characters
“ Welcome to OpenVMS (TM) IA64 Operating System, Version V8.4 ”
. - This logical name is contained in a particular VMS logical name table, specifically the “System table”
(LNM$SYSTEM_TABLE)
.
The value string of this logical name SYS$ANNOUNCE is displayed whenever a user logs-into the system successfully – that's just how it's used (a conventional use). It might be convenient or useful for a sysadmin to change this logical name's value, like this:
$ DEFINE /SYSTEM /EXEC SYS$ANNOUNCE " Welcome to OpenVMS v8.4 on system PLUTO" %DCL-I-SUPERSEDE, previous value of SYS$ANNOUNCE has been superseded
The information message %DCL-I-SUPERSEDE
just confirms to the sysadmin that the value of that logical name has been replaced (superseded); this could have been suppressed by including the qualifier /NOLOG
in the DEFINE
command above.
You don't have to be the sysadmin to use logical names – indeed, there are lots of ways for ordinary VMS users to make use of logical names in their own login sessions.
Typical Uses for Logicals
Three DCL commands suffice for creating and using your own logical names (or “logicals” for short):
DEFINE
– creates a logical name, or replaces the value string for an existing logicalSHOW LOGICAL
– displays the name and value string of an existing logicalDEASSIGN
– deletes (erases) a logical
See the HELP entries for each of these commands (an archaic, deprecated ASSIGN
command exists – don't use it, we'll not cover it here).
Logical names are recognized and interpreted automatically in DCL commands (and other context) wherever they occur. Other than defining your logical(s), you don't need to do anything special to actually use them – VMS takes care of this for you.
The most common use for logical names is as “short-form names” for files, complete file specifications, and/or directory paths. Some examples for user JSMITH on disk-volume DISK$USERS, and assuming all subdirectories mentioned exist:
$ DEFINE com DISK$USERS:[JSMITH.COMFILES] $ DEFINE logs DISK$USERS:[JSMITH.ARCHIVE.LOGFILES] ! a place for my log-files $ $ ! example of use: $ SUBMIT com:monthly_process /LOG_FILE=logs: /NOPRINT /AFTER=1-MAR-2018
$ DEFINE /NOLOG /JOB SYS$SCRATCH DISK$USERS:[JSMITH.SYS$SCRATCH] ! redefine where scratch/temp files go $ DIRECTORY /SIZE /DATE sys$scratch:*.tmp %DIRECT-W-NOFILES, no files found $ ! empty so far...
$ DEFINE sys$print HPLJ4000 ! point SYS$PRINT at a departmental network printer near me $ PRINT logs:monthly_process.log ! PRINT prints to SYS$PRINT by default
Logical names are tremendously versatile and useful, and any users' efforts to understand and exploit logicals is worth it. This intro just scratches the surface.