HP OpenVMS Systems Documentation
OpenVMS User's Manual
4.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 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.
4.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
Digital 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 Digital 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:
188.8.131.52 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:
4.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 19.
In the following example, BOSTON is the network node name. "HIGGINS ETUHCARAP" is an access control string where:
4.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 5.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 the OpenVMS Guide to Extended File Specifications for information about additional wildcard
Use the asterisk (*) wildcard character to match the following:
You can use the asterisk (*) wildcard character as follows:
4.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:
4.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 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:
184.108.40.206 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 "*".
4.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.
The most versatile interactive tool for creating and modifying text files is the interactive text editor. EVE and EDT are two text editors that are 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 the OpenVMS Guide to Extended File Specifications for further information about creating and
copying files in your environment.
The CREATE command creates a text file. You cannot modify a file with the CREATE command; after you have pressed Return, you cannot return to a previous line to modify a word. You must use a text editor such as EDT or EVE 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 POUND.LIS is created by entering the CREATE command and then typing lines of text:
4.4.2 Copying Files
You can use the COPY command to duplicate:
4.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.
Use the COPY command to copy files from another node to your node. For example, to copy the latest version of all files in the directory DISK2:[PUBLIC] on node CHAOS to files with the same names in your default directory, enter the following command:
4.4.5 Copying Files from Your Node to a Remote Node Using DECnet
Use the COPY command to copy files from your node to another node. If you receive a protection violation or DECnet error message when you attempt to copy a file across systems, you can either use mail to copy the file or you can use an access control string.
In the following example, the latest version of all files in the default directory are copied to files with the same names in the directory DISK2:[STAFF_BACKUP] on node CHAOS:
4.4.6 Copying Files on Remote Systems Using TCP/IP
TCP/IP uses the File Transfer Protocol (FTP) service to access and
transfer files to and from another host over a network. To copy files
from a remote host to your local host, use the GET command. To copy
files from your local host to a remote host, use the PUT command. To
use these commands, you must have an active FTP session with a remote
host. You can enter any number of FTP commands during the session. For
information on using FTP commands, refer to the Digital TCP/IP
Services for OpenVMS User's Guide.
If the file is yours, you can use Mail to send it to a user account on the other node.
For more information on using Mail to send files, see Chapter 6.
In the following example, the file FEES.DAT is sent to the JONES account on node CHAOS:
4.4.8 Using Access Control Strings to Copy Files
To copy files after you have received a protection violation, you can follow the node name in the file specification with an access control string (see Section 4.1.12).
In the following example, the user has an account on node CHAOS with the user name SMITH and the password SPG96PRT. The user is copying the latest version of all files in the default directory to the account on CHAOS.
4.4.9 Renaming Files
Use the RENAME command to give the file a new name and optionally to locate it in a different directory. Note that after being renamed, the original file no longer exists. When you use the RENAME command, the input and output locations must be on the same device.
In the following example, the file FEES.DAT is given the new name RECORDS.DAT and it is moved from the default directory to the [SAVETEXT] directory:
4.5 Displaying the Contents of Files
The following sections describe how to display the contents of files
with tools and commands supported in an OpenVMS environment.
To display the contents of a file on your screen, enter the TYPE command and the file name at the DCL prompt. You do not have to specify the version number in the file specification because the system displays the latest version of a file by default.
In the following example, the latest version of the file STAFF_VACATIONS.TXT is displayed:
4.5.2 Controlling the Display
To stop the scrolling of the text on the screen temporarily, press the Hold Screen key (F1 on VT200 and VT300 series terminals); to resume scrolling, press the Hold Screen key again. To stop the display and return to DCL command level, press Ctrl/Y or Ctrl/O.
If you specify the /PAGE qualifier to the TYPE command, you can view one screen at a time. The system prompts you to press Return when you want to see the next screen.