Document revision date: 30 March 2001
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]
OpenVMS Record Management Services Reference Manual

OpenVMS Record Management Services Reference Manual

Order Number: AA-PV6RD-TK

April 2001

This reference manual contains general information intended for use in any OpenVMS programming language, as well as specific information on writing programs that use OpenVMS Record Management Services (OpenVMS RMS).

Revision/Update Information: This manual supersedes the OpenVMS Record Management Services Reference Manual, OpenVMS Alpha Version 7.2 and OpenVMS VAX Version 7.2

Software Version: OpenVMS Alpha Version 7.3
OpenVMS VAX Version 7.3

Compaq Computer Corporation
Houston, Texas

© 2001 Compaq Computer Corporation

Compaq, AlphaServer, VAX, VMS, the Compaq logo Registered in U.S.
Patent and Trademark Office.

Alpha, PATHWORKS, DECnet, DEC, and OpenVMS 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.

Contents Index


Intended Audience

This document describes OpenVMS Record Management Services (RMS) control blocks and services for programmers.

Document Structure

This document consists of three parts and two appendixes.

Related Documents

The following documents contain information related to this reference manual:

For additional information about Compaq OpenVMS products and services, access the Compaq website at the following location: 

Reader's Comments

Compaq welcomes your comments on this manual. Please send comments to either of the following addresses:
Mail Compaq Computer Corporation
OSSG Documentation Group, ZKO3-4/U08
110 Spit Brook Rd.
Nashua, NH 03062-2698

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, any reference to OpenVMS is synonymous with Compaq OpenVMS.

VMScluster systems are now referred to as OpenVMS Cluster systems. Unless otherwise specified, references to OpenVMS Clusters or clusters in this document are synonymous with VMSclusters.

The following conventions are used in this manual:
Ctrl/ x A sequence such as Ctrl/ x indicates that you must hold down the key labeled Ctrl while you press another key or a pointing device button.
PF1 x A sequence such as PF1 x indicates that you must first press and release the key labeled PF1 and then press and release another key or a pointing device button.
[Return] In examples, a key name enclosed in a box indicates that you press a key on the keyboard. (In text, a key name is not enclosed in a box.)

In the HTML version of this document, this convention appears as brackets, rather than a box.

... A horizontal ellipsis in examples indicates one of the following possibilities:
  • Additional optional arguments in a statement have been omitted.
  • The preceding item or items can be repeated one or more times.
  • Additional parameters, values, or other information can be entered.
A vertical ellipsis indicates the omission of items from a code example or command format; the items are omitted because they are not important to the topic being discussed.
( ) In command format descriptions, parentheses indicate that you must enclose choices in parentheses if you specify more than one.
[ ] In command format descriptions, brackets indicate optional choices. You can choose one or more items or no items. Do not type the brackets on the command line. However, you must include the brackets in the syntax for OpenVMS directory specifications and for a substring specification in an assignment statement.
| In command format descriptions, vertical bars separate choices within brackets or braces. Within brackets, the choices are optional; within braces, at least one choice is required. Do not type the vertical bars on the command line.
{ } In command format descriptions, braces indicate required choices; you must choose at least one of the items listed. Do not type the braces on the command line.
bold text This typeface represents the introduction of a new term. It also represents the name of an argument, an attribute, or a reason.
italic text Italic text indicates important information, complete titles of manuals, or variables. Variables include information that varies in system output (Internal error number), in command lines (/PRODUCER= name), and in command parameters in text (where dd represents the predefined code for the device type).
UPPERCASE TEXT Uppercase text indicates a command, the name of a routine, the name of a file, or the abbreviation for a system privilege.
Monospace text Monospace text indicates code examples and interactive screen displays.

In the C programming language, monospace type in text identifies the following elements: keywords, the names of independently compiled external functions and files, syntax summaries, and references to variables or identifiers introduced in an example.

- A hyphen at the end of a command format description, command line, or code line indicates that the command or statement continues on the following line.
numbers All numbers in text are assumed to be decimal unless otherwise noted. Nondecimal radixes---binary, octal, or hexadecimal---are explicitly indicated.

Part 1
OpenVMS RMS---General Information

Part I introduces the reader to general mechanisms and conventions associated with Record Management Services (RMS). It discusses the following topics:

Chapter 1
Introduction to RMS

This section presents an overview of the general functions available through RMS. It also briefly describes the record management services and related control blocks.

1.1 RMS Functions

RMS is a set of generalized services that assist application programs in processing and managing files and their contents. OpenVMS languages may invoke these services using appropriate macros stored in system libraries using the OpenVMS calling standard. Record management services are system services identified by the entry point prefix SYS$ followed by three or more characters; but the SYS prefix is omitted in the corresponding VAX MACRO macro name. For example, the Create service has an entry point of SYS$CREATE and a VAX MACRO macro name of $CREATE. A complete description of each service is provided in Part 3.

Table 1-1 describes the functions of each service, including the service entry point name and its corresponding VAX MACRO macro name.

Table 1-1 Record Management Services
Service Name Macro Name Description
File Processing and File Naming Macros
SYS$CLOSE $CLOSE Terminates file processing and disconnects all record streams previously associated with the file
SYS$CREATE $CREATE Creates and opens a new file
SYS$DISPLAY $DISPLAY Returns the opened file's attributes to the application program
SYS$ENTER 1 $ENTER Enters a file name into a directory
SYS$ERASE $ERASE Deletes a file and removes its directory entry
SYS$EXTEND $EXTEND Allocates additional space to a file
SYS$OPEN $OPEN Opens an existing file and initiates file processing
SYS$PARSE $PARSE Parses a file specification
SYS$REMOVE 1 $REMOVE Removes a file name from a directory but does not actually delete the file data; compare this with the $ERASE macro
SYS$RENAME $RENAME Assigns a new name to (renames) a file
SYS$SEARCH $SEARCH Searches a directory, or possibly multiple directories, for a file name
Record Processing Macros
SYS$CONNECT $CONNECT Establishes a record stream by associating a RAB with an open file
SYS$DELETE $DELETE Deletes a record from a relative or indexed file
SYS$DISCONNECT $DISCONNECT Terminates a record stream by disconnecting a RAB from an open file
SYS$FIND $FIND Locates the specified record, establishes it as the current record and returns the record's RFA to the application program
SYS$FLUSH $FLUSH Writes (flushes) modified I/O buffers and file attributes to the disk before closing a file
SYS$FREE $FREE Unlocks all records previously locked by the record stream
SYS$GET $GET Retrieves a record from a file
SYS$NXTVOL 1 $NXTVOL Causes processing of a magnetic tape file to continue to the next volume of a volume set
SYS$PUT $PUT Writes a new record to a file
SYS$RELEASE $RELEASE Unlocks a record pointed to by the contents of the RAB$W_RFA field
SYS$REWIND $REWIND Establishes the first file record as the current record
SYS$TRUNCATE $TRUNCATE Truncates a sequential file
SYS$UPDATE $UPDATE Deletes and rewrites (updates) an existing file record
SYS$WAIT $WAIT Awaits the completion of an asynchronous record operation
Block I/O Processing Macros
SYS$READ $READ Retrieves a specified number of bytes from a file, beginning on block boundaries
SYS$SPACE $SPACE Positions forward or backward in a file to a block boundary
SYS$WRITE $WRITE Writes a specified number of bytes to a file, beginning on block boundaries

1This service is not supported for network operations involving file access between remote OpenVMS systems.

Although RMS supports unit-record devices, such as terminals and printers, it primarily provides a comprehensive software interface to mass storage devices, such as disk and magnetic tape drives.

RMS provides a variety of disk file organizations, record formats, and record access modes from which you can select the appropriate processing techniques for your application. RMS supports sequential, relative, and indexed file organizations, and fixed-length and variable-length record formats are supported for each file organization. (Relative and sequential files also support other record formats.) The RMS record access modes permit you to access records sequentially, directly by key value, directly by relative record number, or directly by record file address (RFA). RMS also provides a means of performing block I/O operations for users with certain performance-critical applications (such applications may require user-defined file organizations or record formats, or both).

RMS ensures safe and efficient file sharing by providing:

RMS also enforces the security requirements of a multiuser system with potential multinode access by restricting file access to one or more user types and a list of user names.

For systems that support network capabilities, RMS provides a subset of file and record management services through the data access protocol (DAP) to remote network nodes. Network DAP remote file operations are generally transparent to application programs.

1.2 Passing Arguments to RMS

RMS flexibility requires application programs to pass a multitude of arguments to RMS services for doing common operations such as file creation and file access. To minimize the problems associated with passing numerous arguments for each service call, the application program places the arguments in one or more data control blocks before it invokes a record management service. The only argument required for most services is the symbolic address of the appropriate data control block.

1.2.1 Record Management Services and Control Blocks

Because RMS operates on files and records, its services generally belong to one of two groups:

To support service operations, RMS provides two types of control blocks:

1.2.2 Control Blocks for File Services

File services use a control block called the file access block (FAB). When creating a file, the user must store arguments in the FAB that define the file characteristics, the file specification, and certain run-time access options. When your process opens an existing file, the FAB specifies only the file specification and the run-time access options.

There are three categories of FAB arguments; the following list briefly introduces each category.

The two types of optional control blocks that can supplement or supersede the information in the FAB are the extended attribute block (XAB, pronounced "zab") and the NAM or NAML block.

A XAB usually supersedes and supplements the file characteristics specified in the associated FAB, and multiple XABs may support a single file. There are several types of XABs, each of which is used for a different purpose. Each type of XAB has a 6-letter mnemonic name consisting of the prefix "XAB" followed by a 3-letter mnemonic that relates to the XAB function. For instance, the XAB that supplements and supersedes the file allocation information in the FAB is called an allocation control XAB, or XABALL.

The XABs used for file operations are briefly described in the following list:

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