[OpenVMS documentation]
[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
Updated: 11 December 1998

OpenVMS User's Manual


Previous Contents Index


Chapter 4
Files: Storing Information

This chapter describes how to create and manipulate files locally, and over a DECnet for OpenVMS network. This chapter includes information about:

For additional information, refer to the following:

4.1 Understanding File Names and File Specifications

A file is a unit that the OpenVMS operating system uses to store human-readable and machine-readable data. When you create or name a file, you must specify certain information so that the system can locate and identify the file. You do not have to include all the elements of a complete file specification (see Section 4.1.1). However, you must include a file name or file type to identify it to both the system and you. For example, PAYROLL_MEMO.TXT is a valid file specification. PAYROLL_MEMO is the file name, and .TXT is the file type.

Note

If you are working in an environment with Extended File Specifications, refer to the OpenVMS Guide to Extended File Specifications for specific information about extended file names and the expanded character set available.

4.1.1 Providing a Complete File Specification

To override system defaults or to perform file operations over a network, you must provide a complete file specification. A complete file specification has the following format:

node::device:[directory]filename.filetype;version 

The elements are as follows:
Node A network node name; applicable only to systems that support DECnet for OpenVMS. Does not apply to files stored on magnetic tape.
Device The name of the physical device on which the file is stored or is to be written. For information on accessing files stored on physical devices, see Section 12.6.
Directory The name of the directory under which the file is cataloged. Square brackets ([]) or angle brackets (<>) can be used to delimit directory names. Does not apply to files stored on magnetic tape.
Filename The name of the file. It can have up to 39 alphanumeric characters, including the hyphen and the underscore.
Filetype Identification of the structure or the type of data in the file. The file type can have up to 39 alphanumeric characters, including the hyphen and the underscore.
Version The version number of the file. Versions are identified by a decimal number, which is incremented by 1 each time a new version of the file is created. The system automatically assigns a version number unless you specify one.

4.1.2 Rules for File Specifications

Use the following rules to specify the elements of a file specification:

Note

Note that these rules differ for files in an environment with Extended File Specifications. Refer to the OpenVMS Guide to Extended File Specifications for more specific information about extended file names.

4.1.3 Default File Types Used by DCL Commands

With certain commands, if you omit the file type, the system applies a default value. The following table lists some of the more common default file types used by DCL commands:
File Type Contents
.CLD Command description file
.COM Command procedure file
.DAT Data file
.DIF Output file created by the DIFFERENCES command
.DIR Directory file
.DIS Distribution list file for the Mail utility
.EDT Startup command file for the EDT editor
.EXE Executable program image file created by the linker
.HLB Help text library file
.HLP Input source file for help libraries
.INI Initialization file
.JOU Journal file created by the EDT editor
.LIS Listing file created by a language compiler or assembler; default input file for the PRINT and TYPE commands
.LOG Batch job output file
.MAI Mail message file
.MEM Output file created by DIGITAL Standard Runoff (DSR)
.PS POSTSCRIPT format file
.REGIS Regis format file
.RNO Input source file for DIGITAL Standard Runoff (DSR)
.SIX Sixel graphic file
.SYS System image file
.TJL Journal file created by the DECTPU and ACL editors
.TLB Text library file
.TMP Temporary file
.TPU Command file for the EVE editor
.TPU$JOURNAL Journal file created by the EVE editor
.TXT Input file for text libraries or Mail utility output files

4.1.4 Default File Types for Language Source Programs

The following table lists the default file types for some high-level language source programs:
File Type Contents
.ADA Input source file for the DEC Ada compiler
.BAS Input source file for the BASIC compiler
.B32 Input source file for the VAX BLISS-32 compiler
.C Input source file for the DEC C compiler
.COB Input source file for the VAX COBOL compiler on OpenVMS VAX systems and the DEC COBOL compiler on OpenVMS Alpha systems
.FOR Input source file for DEC Fortran (DEC Fortran for OpenVMS VAX systems was formerly VAX Fortran)
.M64 Input source file for the MACRO-64 assembler for OpenVMS Alpha
.MAP Memory allocation map created by the Linker utility
.MAR Input source file for the VAX MACRO assembler or the MACRO-32 Compiler for OpenVMS Alpha
.MLB Macro library for the MACRO assembler
.MSG Source file that specifies the text of messages
.OBJ Object file created by a language compiler or assembler
.OLB Object module library
.OPT Options file for input to the LINK command
.PAS Input source file for the Pascal compiler
.PLI Input source file for the PL/I compiler
.STB Symbol table file created by the Linker utility
.UPD Update file of changes for a VAX MACRO source program; also input to the SUMSLP utility

4.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.

4.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:

node["access-control-string"]:: 

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

4.1.7 Specifying 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:


"MARY:.UNIVERSITY.""SCIENCE LAB""" 

Other examples of valid full node names are:

4.1.8 Accessing Files on Remote Nodes

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.

Note

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.

4.1.9 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 for OpenVMS Networking Manual.

4.1.9.1 Conventional File Specification

The conventional format for files is:

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

4.1.9.2 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:

node::"foreign-file-spec-string" 

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" *

4.1.9.3 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:

node::"task-spec-string"

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


BOSTON::"TASK=TEST2"

Note

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

4.1.10 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:

node"access-control-string":: 

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:


$ DIR BOSTON"HIGGINS ETUHCARAP"::WEASEL2:[BORIS]ACCOUNTS.DAT

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 (%). They 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.) You can also use an asterisk, but not a percent sign in version numbers.

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 options.


Previous Next Contents Index

[Site home] [Send comments] [Help with this site] [How to order documentation] [OpenVMS site] [Compaq site]
[OpenVMS documentation]

Copyright © Compaq Computer Corporation 1998. All rights reserved.

Legal
6489PRO_007.HTML