Introduction MTB Statements File System Compiler Applications Reference Guide Index

Overview Keyed Files Indexed Sequential Files Text Files File I/O Operations

File I/O Operations

The MTB language provides over twenty statements related to file input and output operations. These are explained in detail in the Procedure Division documentation.

Below is a brief summary of the most common file operations. Note that some of these operations may not be performed simultaneously by multiple users, or actions taken by one user could affect file operations attempted by another.

At the highest level, MTB file operations include statements to open, close, create, erase, rename, lock, and unlock a file, including:

CREATE
ERASE
RENAME
OPEN
CLOSE
LOCK
UNLOCK

Note: Starting with Comet version 504.211, whenever a filename is referenced in a Comet statement (in the OPEN, CREATE, and RENAME statements, for example), the system converts the filename to upper case before making the call. This change was made in response to some case-sensitive problems encountered on several Windows NT installations.

Once a data file is created and opened, normal I/O operations may proceed. MTB provides statements for reading records, writing records, reading and locking records, deleting records, etc. These include:

WRITE
READ
EXTRACT
INQUIRE
DELETE

MTB also provides statements for inserting, rewriting, and updating data records, including:

UPDATE
INSERT
REWRITE

In addition to these direct input/output statements, MTB provides several file functions, including:

FIRST
LAST
KEY
ORD
POSITION
PREV
RECNUM