HP OpenVMS Systems Documentation
Guide to OpenVMS File Applications
Order Number: AA-PV6PD-TK
This document is intended for application programmers and designers who write programs that use OpenVMS RMS files.
Revision/Update Information: This manual supersedes the Guide to OpenVMS File Applications, OpenVMS Alpha Version 7.2 and OpenVMS VAX Version 7.2
OpenVMS Alpha Version 7.3
© 2001 Compaq Computer Corporation
Compaq, AlphaServer, VAX, VMS, the Compaq logo Registered in U.S.
Alpha, OpenVMS, PATHWORKS, DECnet, and DEC are trademarks of Compaq Information Technologies Group, L.P. in the United States and other countries.
UNIX and X/Open are trademarks of The Open Group in the United States and other countries.
All other product names mentioned herein may be the trademarks of their respective companies.
Confidential computer software. Valid license from Compaq required for possession, use, or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.
Compaq shall not be liable for technical or editorial errors or omissions contained herein. The information in this document is provided "as is" without warranty of any kind and is subject to change without notice. The warranties for Compaq products are set forth in the express limited warranty statements accompanying such products. Nothing herein should be construed as constituting an additional warranty.
The Compaq OpenVMS documentation set is available on CD-ROM.
This document is intended for applications programmers and designers who create or maintain application programs that use RMS files.
You may also read this document to gain a general understanding of the file- and record-processing options available on an OpenVMS system.
This guide contains 10 chapters, one appendix, and a glossary.
The reader should be familiar with the information in the following documents:
Related reference information is available in the following documents:
For additional information about Compaq OpenVMS products and services, access the Compaq website at the following location:
Compaq welcomes your comments on this manual. Please send comments to either of the following addresses:
How To Order Additional Documentation
Use the following World Wide Web address to order additional documentation:
If you need help deciding which documentation best meets your needs, call 800-282-6672.
In this manual, every use of DECwindows and DECwindows Motif refers to DECwindows Motif for OpenVMS software.
The following conventions are also used in this manual:
|Sequential Access||Records are stored or retrieved one after another starting at a particular point in the file and continuing in order through the file.|
|Relative Record Number Access||Records are stored and retrieved by relative record number or by file address. Records occupy cells of equal length, and each cell is assigned a relative record number, which represents the cell's position relative to the beginning of the file.|
|Record File Address Access||When a record is accessed directly by its file address, the distinction is made by its unique location in the file; that is, its record file address (RFA).|
|Indexed Access||Indexed file records are stored and retrieved by a key in the data record. The desired records are usually accessed directly and then retrieved sequentially in sorted order using a key embedded in the record.|
The record format refers to the way all records in a file appear physically on the recording surface of the storage medium and is defined in terms of record length. Table 1-2 describes the four record formats supported by RMS.
|Fixed length||All records are the same length.|
|Variable length||Records vary in length. Each record is prefixed with a count byte that contains the number of bytes in the record. The count byte may be either MSB- or LSB-formatted.|
Variable record length with
|Records do not have to be the same length, but each includes a fixed-length control field that precedes the variable-length data portion.|
|Stream||Records are delimited by special characters or character sequences called terminators. Records with stream format are interpreted as a continuous sequence, or stream, of bytes. The carriage return and the line feed characters are commonly used as terminators.|
When you design a file, you specify the file storage medium and the file and record characteristics directly through your application program or indirectly using an appropriate utility. Chapter 2 outlines RMS file organization, record access modes, and record characteristics in detail.
After RMS creates the file, the application program must consider these record characteristics when storing, retrieving, and modifying records. See Chapter 4 for information about creating files, populating files with records, and protecting files. See Chapter 8 for information about record processing, including record access modes; synchronous and asynchronous record operations; and retrieving, inserting, updating, and deleting records.
The maximum size of an RMS file has no built-in limitation other than
the 32-bit virtual block number (VBN). In terms of blocks, a single
file is limited to a VBN that must be described in 32 bits. So the
maximum size of an RMS file is about 4.2 billion (4,294,967,295)
blocks. In terms of bytes, this is equivalent to 2 terabytes.
1.2 Disk Concepts
This section describes disk concepts as an aid to understanding how a disk may be configured to enhance data access for improved performance. Disk structures may be defined as either logical or physical and the two types interact with each other to some degree. That is, you cannot manipulate a logical structure without considering the effect on a corresponding physical structure.
RMS disk files reside on Files--11 On-Disk Structure (ODS) disks. Files--11 is the name of the disk structures supported by the operating system. Files--11 disk structures are further characterized as being either on-disk structures or CD-ROM volume and file structures. The Files--11 structure is a hierarchical organization of files, their data, and the directories needed to gain access to them. The OpenVMS file system implements the Files--11 on-disk structure and provides random access to the files located on the disk or CD-ROM. Users can read from and write to disks; they can only read from CD-ROMs.
On-disk structures include levels 1, 2, and 5. (Levels 3 and 4 are internal names for ISO and High Sierra CD formats.) ODS-1 and ODS-2 structures have been available on OpenVMS systems for some time. Beginning with OpenVMS Version 7.2--EFT2 on Alpha systems, you can also specify ODS-5 to format disks.
Table 1-3 compares the characteristics of file structures that are available on OpenVMS Version 7.2--EFT1 systems.
|Structure||Disk or CD||Description|
|ODS-1||Both||VAX only; use for RSX compatibility: RSX--11M, RSX--11D, RSX--11M--PLUS, and IAS operating systems|
|ODS-2||Both||Default disk structure of the OpenVMS operating system; use to share data between VAX and Alpha with full compatibility.|
|ODS-5||Both||Alpha only 1; superset of ODS-2; use when working with systems like NT that need expanded character sets or directories deeper than ODS-2.|
|ISO 9660 CD||CD||ISO format files: read by systems that do not have ODS-2 capability such as PCs, NT systems, and MACs.|
|Dual format||CD||Single volume with both ISO 9660 CD and Files-11 CD formats. Files are accessible to both formats whose directories might point to the same data.|
|Foreign||Both||A structure that is not related to a Files--11 structure. When you specify a foreign structure, you make the contents of a volume known to the system, but the system makes no assumptions about its file structure. The application is responsible for supplying a structure.|
Table 1-4 compares the specific characteristics of Files--11 On-Disk Structure (ODS) Levels 1, 2, and 5.
|Characteristic||ODS-1 (VAX only)||ODS-2||ODS-5|
|File names||9.3||39.39||238 bytes, including the dot. For Unicode, that is 119 characters including the dot.|
|Character set||Uppercase alphanumeric||Uppercase alphanumeric plus hyphen (-), dollar sign ($), and underscore (_)||ISO Latin-1, Unicode.|
|File versions||32,767 limit; version limits are not supported||32,767 limit; version limits are supported.||32,767 limit; version limits are supported.|
|Directories||No hierarchies of directories and subdirectories; directory entries are not ordered 1||
VAX: 8 (with rooted logical, 16)
VAX: 8 (with rooted logical, 16).
|System disk||Cannot be an ODS-1 volume||Can be an ODS-2 volume||Cannot be an ODS-5 volume.|
|OpenVMS Cluster access||Local access only; files cannot be shared across a cluster||Files can be shared across a cluster||Files can be shared across a cluster. However, only computers running OpenVMS Version 7.2--EFT1 or later can mount ODS-5 disks. VAX computers running Version 7.2--EFT1 or later can see only files with ODS-2 style names.|
|Disk||Unprotected objects||Protected objects||Protected objects.|
|Disk quotas||Not supported||Supported||Supported.|
|Multivolume files and volume sets||Not supported||Supported||Supported.|
|Placement control||Not supported||Supported||Supported|
|Caches||No caching of file header blocks, file identification slots, or extent entries||Caching of file header blocks, file identification slots, and extent entries||Caching of file header blocks, file identification slots, and extent entries.|
|Clustered allocation||Not supported||Supported||Supported.|
|Backup home block||Not supported||Supported||Supported.|
|Protection code E||E means "extend" for the RSX--11M operating system but is ignored by OpenVMS||E means "execute access"||E means "execute access".|
|Enhanced protection features (for example, access control lists)||Not supported||Enhanced protection features supported||Enhanced protection features supported.|
|RMS journaling||Not supported||Supported||Supported.|