Difference between revisions of "Logical Name"

From VSI OpenVMS Wiki
Jump to: navigation, search
(created this page instead of "Logical names")
 
 
(2 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
Logical names serve two main functions: they increase readability and file independence.
 
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 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 use your login command procedure to define names that you use frequently. 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.  
 
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.  
  
=Characteristics=
+
=Logical Name Tables=
Logical names have the following characteristics:
+
[[Logical Name Table|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.
  
* Are equated to strings (called equivalence strings or equivalence names) or a list of equivalence strings (called search lists). When you use a logical name, the equivalence string is substituted for the logical name.
+
=Logical Name Creation Modes=
* Are stored in default logical name tables or logical name tables that you create.
+
OpenVMS has four access modes depending on how trustworthy the image is:
* Can be shorthand for long file specifications.
 
* Can be defined by you or by the system.
 
* Can be used to keep 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 before executing the command procedure.
 
 
 
=Logical name tables=
 
* [[Cluster logical name table]]
 
* [[System logical name table]]
 
* [[Group logical name table]]
 
* [[Process logical name table]]
 
 
 
=Logical name creation modes=
 
 
* [[User mode]]
 
* [[User mode]]
 
* [[Supervisor mode]]
 
* [[Supervisor mode]]
 
* [[Executive mode]]
 
* [[Executive mode]]
 
* [[Kernel mode]]
 
* [[Kernel mode]]
 +
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=
 
=Types=
* [[Logical search lists]]
+
* [[Logical search lists]]: logical names that have several equivalence strings. When used with the [[DIRECTORY (command)|DIRECTORY]] command, all equivalence strings are used. When used with the [[CREATE]] command, files are created using the first valid equivalence string.
* [[Concealed logicals]]
+
* [[Concealed Logical Name|Concealed]] and [[Rooted Logical Name|rooted]] logicals: logical names that conceal and replace a part of a directory specification.
* [[Rooted logicals]]
+
 
 +
=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=
 +
* {{Template:Userman}} (chapter 11 on logical names)

Latest revision as of 08:45, 6 July 2023

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 use your login command procedure to define names that you use frequently. 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