HP OpenVMS Systems Documentation
OpenVMS User's Manual
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
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
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.
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 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.
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.
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
The conventional format for files is:
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:
126.96.36.199 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:
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 (%).
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:
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:
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.
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:
3.3 Other File Names
The following sections describe other types of file names supported in
an OpenVMS environment.
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:
188.8.131.52 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:
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:
In addition, asterisk (*) character is allowed in ANSI magnetic tape file names.
For details, refer to the Guide to OpenVMS File Applications.
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.
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:
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:
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: