File NamingNext"

Chapter 1: Introduction to File Handling

One of the main facilities COBOL has to offer as a programming language is its built-in file handling capabilities. Files of sequential, relative and indexed organization can be handled using simple COBOL syntax.

Micro Focus COBOL extends the file handling capabilities of COBOL, providing access to several other types of file, as well as an open interface to enable you to provide your own file handling. These extensions include:

1.1 The File Handlers

The Object COBOL systems contain a number of file handlers. This section explains what they are and when they are used.

16-bit:
The 16-bit COBOL system handles line sequential, sequential and relative files as part of the run-time system. Indexed files and external files are handled by the Callable File Handler, ExtFH, which is called directly from the run-time system. This is the default situation.

Instead of using the run-time system to process your files, you can specify the CALLFH Compiler directive to force the Compiler to generate calls to the Callable File Handler for all file handling. You will need to use this method in order to use the many additional facilities offered by the Callable File Handler.

32-bit:
On the 32-bit COBOL systems, all file I/O is handled by the Callable File Handler. In these systems, the Callable File Handler is modular, so you can link with your program just the bits that you need.

In all cases, you can call the Callable File Handlers directly from your programs (C or COBOL) to process COBOL files, or use COBOL syntax. You can replace the file handler with one of your own, using, for example, the byte-stream routines as the low-level mechanism for reading and writing the files.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

File NamingNext"