Document revision date: 15 July 2002
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS User's Manual

Previous Contents Index

3.1.5 File Versions

In addition to a file name and file type, every file has a version number. Version numbers are decimal numbers from 1 to 32,767 that differentiate versions of a file. When you create a file, the system assigns it the version number 1.

You can have several versions of the same file. Unless you specify a version number, the system uses the highest existing version number of that file. If you specify the version number 0, the system uses the highest existing version. When you modify a file with a command, application, or text editor (such as EVE) that creates a new version of the file, the file name remains the same but the version number is incremented by one.

Precede version numbers with a semicolon or a period. When the system displays file specifications, it displays a semicolon in front of the file version number.

You can refer to versions of a file in a relative manner by specifying a zero or a negative version number. Specifying zero locates the latest (highest numbered) version of the file. Specifying -1 locates the next-most-recent version, -2 the version before that, and so on. To locate the earliest (lowest numbered) version of a file, specify -0 as the version number. Note that you cannot create files with a version number higher than 32767. If you attempt to create a new file with a version number higher than 32767, you will receive an error message.

The /VERSION_LIMIT qualifier for the CREATE/DIRECTORY, SET DIRECTORY, and SET FILE commands lets you control the number of versions of a file. If you exceed the version limit, the system automatically purges the lowest version file in excess of the limit. For example, if the version limit is 5 and you create the sixth version of a file (ACCOUNTS.DAT;6), the system deletes the first version of the file (ACCOUNTS.DAT;1). To view the version limit on a file, enter the DIRECTORY/FULL command. The version limit is listed in the File attributes: field.

3.1.6 Network Node Names

A node is an individual computing system that is part of a computer network. If your system is part of a network, the node that you access when you log in is your local node. Other nodes in the network are remote nodes. Use a node name when you want to specify a file on a remote node.

A node specification has the following format:


Observe the following rules when entering a node name as part of a file specification:

3.1.7 Specifying DECnet-Plus Node Full Names

On OpenVMS systems, you can specify node full names. However, you must have DECnet--Plus software installed for full node names to be recognized.

Valid full node names can contain up to 255 characters and can include any characters except the following:

If a full node name is enclosed in quotation marks (" "), it can contain any characters except unmatched quotation marks. Note that if there are quotation marks within the node name, the quotation marks must be doubled and the entire string, including the quotation marks, must also be enclosed in quotation marks.

Although the OpenVMS software enforces few rules on the syntax of node names, the actual set of valid node names is constrained by the DECnet software running on your system. For further information on full names, refer to the DECnet--Plus documentation. The syntax rules, including valid character codes, are described in detail in the DECnet--Plus DECdns Management Guide.

In the following example, the entire string is in quotation marks because there are quotation marks in the node name:


Other examples of valid full node names are:


3.1.8 Specifying TCP/IP Names and Addresses

With TCP/IP, unless otherwise stated, whenever you specify a host on a command line, you can use its host name, a fully qualified domain name, or its IP address. The relative name of a host is a simple name that does not include the fully qualified domain name; that is, it does not include one or more periods (.). Refer to the Compaq TCP/IP Services for OpenVMS User's Guide for the TCP/IP syntax rules.

3.1.9 Accessing Files on Remote Nodes Using DECnet

When you access a file on a remote node, DECnet logs in at the remote node. To do this, the system needs login information for that node. You can supply the system with an access control string. If you omit the access control string, the login information sent to the remote node is determined as follows:

If you include an access control string, the system uses it to log you in to the remote node. The remainder of the file specification is passed to the remote node and is interpreted there.

If you specify a local node as part of a file specification, the system logs you in over the network to perform the file operation, even though the file exists on your local node. For information about additional ways to access remote systems, see the OpenVMS System Manager's Manual.


Throughout the remainder of this chapter, examples that specify a node name do not always include an access control string. This is because proxy accounts enable users to perform operations on the remote systems in these examples.

3.1.10 Accessing Files on Remote Nodes Using TCP/IP

Compaq TCP/IP Services for OpenVMS provides the File Transfer Protocol (FTP) to access and transfer files to and from another host over a network. To use FTP, you need a user account on the OpenVMS system with access to Compaq TCP/IP Services for OpenVMS and a user account on the remote FTP host. In some instances, TCP/IP allows you to connect to a remote host without specifying an account and password. If that feature is not enabled, you must supply user authentication information for a remote host. For information on using FTP commands, refer to the Compaq TCP/IP Services for OpenVMS User's Guide.

3.1.11 Using Network File Specifications

There are three formats for network file specifications:

In each format, the node specification can include an access control string. For more information, see the DECnet User's Manual for your product and the Compaq TCP/IP Services for OpenVMS User's Guide. Conventional File Specification

The conventional format for files is:

node::device:[directory]filename.type;version Foreign File Specification

A foreign file specification is a file that does not conform to OpenVMS syntax. The format used to provide a foreign file specification is:


In the following example, this file name contains a question mark (?), which is not recognized as a valid file name character. Therefore, the file name must be enclosed in quotation marks (" "). It must also be in a format that is recognized by the operating system of the remote node you are accessing:

$ COPY BOSTON::"TEST?.DAT" * Task Specification Strings

A task specification string identifies a program to be executed on the remote node. You can use task specification strings within a program to enable the program to communicate with another program on a remote node. The format used to indicate a task specification string is:


This specification identifies the program TEST2 on the remote node BOSTON:



There are some restrictions when you copy files to or from a UNIX system. For more information, see the OpenVMS Record Management Utilities Reference Manual.

3.1.12 Access Control String Format

Access control strings designate accounts that you can log in to on remote nodes. Node names with access control strings have the following format:


Enclose the access control string in quotation marks (" ") and follow it with a double colon (::).

On OpenVMS systems, the access control string consists of a user name, followed by one or more spaces or tabs and a password. For additional information on access control strings, see Chapter 10.

In the following example, BOSTON is the network node name. "HIGGINS ETUHCARAP" is an access control string where:


3.2 Using Wildcards with File Names

Use wildcard characters to apply a DCL command to multiple files rather than to one file at a time. The command applies to all files that match the portion of the file specification entered.

Many examples in this chapter show the use of wildcard characters in file operations. The use of wildcard characters in DCL commands varies with the individual command.

There are two wildcards available for use with many DCL commands: asterisks (*) and percent signs (%). Both can be used as wildcard characters in directory names, file names, and file types. (See Section 4.5 for information about wildcards used with directories.) In version components, you can use an asterisk (;*), but not a percent sign or a mix of wildcards and numerals.

On Alpha systems running OpenVMS Version 7.2 or greater, the question mark (?) can be used in place of the percent sign (%).

If you are working in an environment with extended file specifications, refer to Chapter 5 for information about additional wildcard options.

3.2.1 Asterisk (*) Wildcard Character

Use the asterisk (*) wildcard character to match the following:

You can use the asterisk (*) wildcard character as follows:


In the following example, the file specification selects all versions of all files in the [FROGMAN] directory:


In the following example, only those files in the current default directory with the file type .DAT are displayed:

$ TYPE *.DAT;*

The command in this example selects all files with the file type .DAT that exist in subdirectories one level below [FROGMAN]:


In the following example, the wildcard characters appear in the directory specification:

$ TYPE [*.*.*]AVERAGE.*;*

This file specification selects all versions of all files named AVERAGE with any file type that exists in any second-level subdirectory on the current default disk. For example, this file specification selects [A.B.C]AVERAGE.DAT but not [X.Y]AVERAGE.DAT.

3.2.2 Percent Sign (%) Wildcard Character

Use the percent sign (%) wildcard character as a substitute for any single character in a file specification. You can use the percent sign in the directory, file name, and file type fields. You cannot, however, use the percent sign in the version number field or in ANSI magnetic tape file specifications. The percent sign replaces one character position in a field, but there must be a character to replace.

You can specify the percent sign as many times as necessary and in combination with other wildcard characters.

The following example displays the latest versions of all .DAT files whose names are DISTRICT followed by a single character:


This display would include the files DISTRICT1.DAT, DISTRICT2.DAT, and DISTRICT3.DAT. The file DISTRICT4_5.DAT would not be displayed because it has more than one character after DISTRICT, nor would the file DISTRICT.DAT be displayed.

The file specification in this example is valid:

$ [MA*]INS%%%A*.J*;*

3.3 Other File Names

The following sections describe other types of file names supported in an OpenVMS environment.

3.3.1 Null File Names and File Types

When a file specification component, such as the file name or the file type, is missing, it is often replaced by a default value during the (built-in) parsing operation of the DCL command or utility. For example, the FORTRAN command uses a default file type or .FOR. The following command would cause the FORTRAN compiler to attempt to compile the file FILE.FOR:


Also, the DIRECTORY command replaces any missing components with an asterisk wildcard. For example, the following command would display all files with the file name FILE, no matter what file type (including a period (.)):


A file can have a name that is null (null value or have a file type that consists of only the delimiter period (which is sometimes referred to as a null file type). For example, the following are valid file names:

TEMP. File References with Null File Types

You can make a reference to a file with a type that consists of only the delimiter period, as follows:

$ DIRECTORY TEMP.         ! 

Because there is no file name delimiter, it is not possible to make a reference to a file with a null file name. A file reference with no file name will always be interpreted as having a missing file name.

The following command will display a list of all files with the type .TMP rather than only the file .TMP because the directory utility will automatically replace the missing file name with "*".


3.3.2 Alternate File Names for Magnetic Tapes

In addition to standard (ODS-2 compatible) file names, the operating system supports an alternate file-naming convention for ANSI-labeled magnetic tapes. The format is as follows:


The file name can contain 1 to 17 characters from the ASCII "a" character set. This set of characters includes numeric characters, uppercase letters, and a space, as well as the following characters:

! " % ' ( ) * + , - . / : ; < => ? & _

In addition, asterisk (*) character is allowed in ANSI magnetic tape file names.

For details, refer to the Guide to OpenVMS File Applications.

3.4 Creating and Modifying Files

The following sections describe how to create and modify files with tools and commands supported in an OpenVMS environment.

You can create and modify text files with an interactive text editor. EVE and EDT are two text editors included in the OpenVMS operating system; other text editors may also be available on your system.

You can also create and modify files by using the DCL commands CREATE, COPY, and RENAME. The following sections describe how to create and modify files using these commands.

If you are working in an environment with extended file specifications, refer to Chapter 5 for further information about creating and copying files in your environment.

3.4.1 Creating Files

The CREATE command creates a text file. You cannot modify a file with the CREATE command; after you have pressed Enter, you cannot return to a previous line to modify a word. You must use a text editor to modify a file created with the CREATE command. Pressing Ctrl/Z signals the end of the file and returns you to DCL command level.

In the following example, a file named TEST.TXT is created by entering the CREATE command and then typing lines of text:

this is a test 

3.4.2 Copying Files

You can use the COPY command to duplicate:


In the following example, the file FEES.DAT is copied to RECORDS.DAT:


In the following example, all .TXT files in the default directory are copied to another directory:

$ COPY *.TXT;* [SAVETEXT]*.*;*

In the following example, only those files in the directory [JONES.LICENSES.DOG] that have been modified since December 11, 1999 are copied to the default directory:


3.4.3 File Concatenation

The COPY command can also be used to concatenate files. For example, to append FEES1.DAT to FEES.DAT (forming a new version of FEES.DAT) in your default directory, enter the following command:


Note that there is no space between the comma after FEES.DAT and the file name FEES1.DAT.

Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement