Logical Name

From VSI OpenVMS Wiki
Jump to: navigation, search

A logical name is a string that can be used in place of another name to represent system objects such as files, directories, devices, or queues. For example, you might assign a logical name to your default disk and directory.

Use

Logical names serve two main functions: they increase readability and file independence.

You can define commonly used files, directories, and devices with short, meaningful logical names. Such names are easier to remember and type than the full file specifications. You can define names that you use frequently in your login command procedure. A system manager can define names that people use frequently in the system startup command procedure.

You can use logical names to keep your programs and command procedures independent of physical file specifications. For example, if a command procedure references the logical name ACCOUNTS, you can equate ACCOUNTS to any file on any disk.

Logical Name Tables

Logical name tables are data structures that store logical names. There are a few pre-defined logical name tables that exist on every system; custom logical name tables can also be created. When logical names are defined, the process logical name table is assumed; to use other tables, add the /TABLE qualifier.

Logical Name Creation Modes

OpenVMS has four access modes depending on how trustworthy the image is:

Logical names can also be created in these different modes. By default, logicals are created in supervisor mode. Logicals created in user mode are available for the run of the next image and then deassigned. Logicals created in executive mode are used by privileged images such as system utilities; SYSNAM or SYSPRV are required to create executive mode logicals in any logical name table. Kernel mode is reserved for the operating system.

Types

  • Logical search lists: logical names that have several equivalence strings. When used with the DIRECTORY command, all equivalence strings are used. When used with the CREATE command, files are created using the first valid equivalence string.
  • Concealed and rooted logicals: logical names that conceal and replace a part of a directory specification.

Commands

Use DEFINE or ASSIGN to create a logical name. By default, the name is created in supervisor mode in the process logical name table. Use /USER_MODE or /EXECUTIVE_MODE to specify a different mode and /TABLE to specify a different table if necessary. Note that you need SYSNAM or SYSPRV to create executive mode logicals, and if you don't have either, the system will just silently define a supervisor mode logical. Use SHOW LOGICAL to display the current logical name definition. /FULL gives you additional information on the logical name type and access mode. Use DEASSIGN to delete a logical name. By default, the logical you indicate is only search among the logicals created in the process logical name table in supervisor mode. Use /EXECUTIVE_MODE and /TABLE to search in other tables and among executive mode logicals.

See also