Menu

AdvancedLogicals

John Malmberg

Advanced Logical Names

Logical names are used for many things on VMS. While primarily they are used as aliases for directories and files, they can also be used to contain configuration data.

A logical name can replace a device, a device and directory, or an entire file specification, or parts of a file specification.

A common configuration mistake with inexperienced system managers and programmers is to use physical device names such as disk drive names for their configuration. Experienced System Managers use logical names to create a virtual environment that is independent of the hardware configuration.

Normally logical names are repetitively translated until they get to an actual file name. Concealed rooted logical names are treated special.

define diskname $1$dia0:

define dirname diskname:[mydir.dir2]

define filename1 testfile.dat

define filename2 diskname:[mydir.dir2]testfile.dat

define filename3 dirname:testfile.dat

What you can not do for a VMS file specification is have a logical name for a directory and then follow that with another directory, unless the first logical name is a concealed rooted logical name.

A concealed rooted logical name makes a directory look like a disk device. Which makes it useful for simulating that applications and users have their own volumes.

A concealed rooted logical name can only reference logical names that refer to disk devices.

When you convert a VMS file specification to Unix format, generally the device part of the specification becomes a directory under root, followed by each directory.

$1$dia0:[foo.bar]baz.txt  == /$1$dia0/foo/bar/baz.txt

A logical name for a device or a directory will also become a directory under root.

diskname: translates to /diskname/

dirname:  translates to /dirname/

filename2 translates to /diskname/mydir/dir2/testfile.dat

A Unix format file specification can have a directory following a logical name as a directory. This is something that a VMS format specification can not do.

This means that while you can easily translate a VMS format file specification to UNIX format, going from a Unix format to a VMS format can result in a loss of information because the logical name may need to be translated. This is because a logical name may have multiple targets, and only one can be picked for creating the resulting VMS name.

The VMS C run time library will generally handle translating Unix format filenames to VMS format filename correctly.

A special concealed logical name of SYS$POSIX_ROOT is used to designate a directory to appear to be the Unix "/" directory.

This allows you to create virtual "/" environments that are local to an application or groups of applications.

A VMS logical name for a directory can also appear as a subdirectory in the current working directory. This can simulate symbolic links on VMS versions that do not support VMS.

dirname:        translates to dirname/

dirname:baz.txt translates to dirname/baz.txt

The C Runtime Settings article describes how these settings affect how logical names are used in Unix format filenames.

The normal settings are for logical names to take precedence over file names or directory names.

It is concealed rooted logical names that are of interest when setting up a VMS system for development.

If you have administrative rights to a VMS system and need to learn how to set it up, the procedures are actually similar to what will be described below. The differences are:

  • The Concealed Rooted logical names will be set by the SYS$MANAGER:SYLOGICALS.COM, SYS$MANAGER:STARTUP_VMS.COM or a command file that is called by them. I use SYS$COMMON:[SYSMGR] for the location as SYS$MANAGER is a effectively search list for SYS$SPECIFIC:[SYSMGR], SYS$COMMON:[SYSMGR].
    The Introduction to VMS System Management article will describe this in more detail.

  • Generally the logical names will be put in the SYSTEM table in EXECUTIVE mode so that they are trusted.

A non-privileged user only can put logical names in the JOB or process tables.

HP has set up an Open Source VMS Cluster for development. This cluster has basically just been set up with the software installed, but has not been set up with the concealed rooted logical names for the disk space, so developers need to set up an environment to match their needs.

The article HP Open Source Cluster Info
contains an example of a command procedure to set up simulated roots on a system that had not already assigned logical names for disks.

Before Digital was bought by Compaq and then HP, the DECUS user group set up a system known as DECUServe that is now an open access VMS cluster that is primarily set up as a technical discussion board. It does have full program development capabilities.

The article Encompasserve.org System Info
contains an example of a command procedure to set up for simulated roots on a system that does have logical names assigned for disks.

The article Extending the GNV Environment explains how to set up a logical name search list for non-privileged users to be able to add files to the GNV directory. This allows you to test installs and to use different versions of applications.


Related

Wiki: CRuntimeSettings
Wiki: HpOpenSourceClusterInfo
Wiki: IntroVMSEnvironment

MongoDB Logo MongoDB