Previous Page | Next Page

Introduction to the OpenVMS Operating Environment

OpenVMS Filenames


Syntax for File Specifications


What Is a Fully Qualified Name?

A fully qualified name indicates how a file fits into a structure (a system of directories and subdirectories) that contains all the files stored under the OpenVMS system. The following type of file specification is a fully qualified name:

node::device:[directory]filename.file-type;version

Rules for File Specifications

A file specification cannot exceed 255 bytes. The directory and file-specification can each consist of up to 39 characters. The file-type can consist of up to 38 characters, although most of the default file types have only 3 characters. Permissible characters are the letters A through Z, the numbers 0 through 9, an underscore (_), a hyphen (-), or a dollar sign ($). You can enter OpenVMS filenames and file types in uppercase, lowercase, or mixed case, but all characters are stored in uppercase format. For more information about file specifications, see OpenVMS Guide to Extended File Specifications.

Note:   The default for OpenVMS filenames is the traditional ODS-2 syntax. However, SAS supports the extended ODS-5 syntax on ODS-5 enabled volumes. For more information, see ODS-5 File Naming Conventions.  [cautionend]


Description of File Specification Fields

In many cases, you can uniquely identify a file even without specifying all of the fields in a fully qualified name. The following definitions give default values for fields that can be omitted from a file specification:

node

specifies a node name in an OpenVMS network. The node specification is always followed by a double colon (::). The default value for node is your OpenVMS system node; therefore, include node in the fully qualified name only when you require access to a file that is located on a different node in your OpenVMS network.

device

specifies the name of the physical or logical disk that contains the file. The device specification is always followed by a single colon (:). The default value for device is your current disk. When you log in, the default disk is the disk that is associated with your user ID. Include device in the fully qualified name only when you need to access a file on another disk.

directory

specifies the name of a directory or a sequence of directories. The directory specification must be enclosed in brackets; for example, [DIR1.DIR2.DIR3]. The directories that follow the first directory in the sequence are called subdirectories. In the previous example, DIR2 is a subdirectory of DIR1, and DIR3 is a subdirectory of DIR2.

The default value for directory is the default directory. Include directory in the fully qualified name only when you need to access a file that is not in your default directory. (For more information about the default directory, see Directories.)

Note:   You can substitute angle brackets (< >) for square brackets ([ ]) in directory specifications.  [cautionend]

file-specification

specifies the name of a particular file within the directory. If the file is a SAS file, the filename must also comply with SAS naming conventions. (For details about SAS naming conventions, see SAS Language Reference: Dictionary.) The file-specification field has no default value unless you use a wildcard character.

file-type

usually describes the contents of the file. The file-type must be preceded by a period (.).

The default value for file-type depends on how the file is created or used. For example, some DCL commands assume default file types. You can assign a file type when you create a file.

version

specifies the version number of the file. Each time you modify or create and save a file, OpenVMS increments the highest existing version number for that file, and adds the new version to the directory. Version numbers can range from 1 to 32,767. If you request a file without specifying the version number, then you access the latest version of the file by default. (The latest version of the file is the one that has the highest version number.) If you specify a version number, you must precede it with either a semicolon (;) or a period (.).

Your system manager sets the maximum number of versions of a file that are saved at any given time. For example, if you have edited a file named [DIR1] PROG.DAT 1,000 times and your system is set to keep four backup versions, then the directory [DIR1] contains the following versions:

PROG.DAT;1000
PROG.DAT;999
PROG.DAT;998
PROG.DAT;997

When you edit PROG.DAT the next time (version 1001), PROG.DAT;1001 is created and PROG.DAT;997 is deleted.


ODS-5 File Naming Conventions


Difference between the ODS-2 and ODS-5 File Naming Conventions

Although the default file naming convention is ODS-2, SAS accepts the extended ODS-5 syntax on ODS-5 enabled volumes. This extended file naming convention enables users to create filenames similar to those in the UNIX and Windows environments. The ODS-5 file naming convention behaves like the Windows convention. For example, if a filename exists in all uppercase, then any lowercase or uppercase reference to that file will resolve to uppercase.


Benefits of Using the ODS-5 Volume Structure

Some benefits of using the ODS-5 volume structure include the following:

For more information about the extended ODS-5 syntax, see the OpenVMS Guide to Extended File Systems.


Wildcards in OpenVMS Filenames

OpenVMS supports two general-purpose wildcard characters: the asterisk (*) and the percent sign (%). In DCL commands, you can use these wildcard characters in file specifications to operate on a group of files instead of on a specific file.

Note:   Using wildcard characters in file specifications can degrade the performance of your operating environment.  [cautionend]

For additional rules for using wildcard specifications in operations across nodes in a network, see OpenVMS Networking Manual.

For information about using wildcards in file and directory specifications, see Using Wildcard Characters in External File Specifications.


The Asterisk

The asterisk (*) replaces zero or more characters in one or more of the directory, file-specification, file-type, and version fields in a file specification. It causes the DCL command to act on all files whose names match the fields that you include in the specification. For example, all of the following file specifications match CAT.SAS:

The asterisk (*) often references sets of files in DCL commands such as PRINT, TYPE, and COPY. For example, the following command prints all versions of all files in directory [DIR1] that have the file type .SAS:

$ PRINT [DIR1]*.SAS;*


The Percent Sign

The percent sign (%) replaces a single character in directory, file-specification, and file-type fields in the file specification. For example, the following command prints all versions of every file whose name has five characters beginning with the letters PROG and whose file type is .SAS:

$ PRINT PROG%.SAS;*

In other words, you can use the previous example to print files PROG1.SAS through PROG9.SAS, but not file PROG10.SAS. To print all versions of every file whose name begins with the letters PROG and whose file type is .SAS, enter the following command:

$ PRINT PROG*.SAS;*

Previous Page | Next Page | Top of Page