Overview [ Micro Focus COBOL System Reference, Volume 1 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 1
Overview
This chapter describes both the call interface of the file handler and
the special features available.
The file handler is used automatically by this COBOL system for all
operations on all files with the following exception. Under DOS, Windows
and OS/2 this is true only if you compile your program with the CALLFH
Compiler directiveset. If you do not, the file handler is used by this
COBOL system in the following ways:
* The file handler is called by the run-time system to handle I/O
operations on all files with organization indexed.
* The Compiler places direct calls to the file handler in your
compiled code to handle I/O operations on files of all
organizations which have the ANSI'85 attribute of EXTERNAL.
Under the UNIX operating system, you can create a run-time system that is
linked to your file handler(s) rather than the default file handler(s)
supplied with this COBOL system. The default file handlers for
the various types of file organization and record format are as
follows:(UNIX)
----------------------------------------------------------------
| | |
| | Default File Handler |
| File Type | |
| | |
----------------------------------------------------------------
| | | |
| | Fixed Length Records | Variable Length |
| | | Records |
| | | |
----------------------------------------------------------------
| | | |
| line- | lsfile | lsfilev |
| sequential | | |
| | | |
----------------------------------------------------------------
| | | |
| sequential | sqfile | sqfilev |
| | | |
----------------------------------------------------------------
| | | |
| indexed | ixfile | ixfilev |
| | | |
----------------------------------------------------------------
| | | |
| relative | rlfile | rlfilev |
| | | |
----------------------------------------------------------------
The file handlers you link to the Run-Time System in preference to any of
the default file handlers shown here must conform to the format of the
call interface described in this chapter.
The existence of a separate file handler creates two useful
opportunities:
* The file handler can be called by user applications to perform
specialized file processing outside the normal program
environment.
* The file handler can be replaced with a user-written file handler
to perform specialized file processing within the normal program
environment.
Using the interface described here, you can access the file handler
directly using the CALL statement in your program. You can handle all
I/O without COBOL I/O syntax, though we do not recommend this for normal
file handling. This facility can also be used from other languages,
allowing access to COBOL format files from C, for example.
The advantage of the file handler used in this way allows the creation of
dynamic file processing tools, as well as sophisticated database-type
applications.
This chapter covers the following topics:
* Multiple OPEN operations on the same file
* FCD access (the FCDREG directive)
* Sparse keys
* Fast processing of duplicate keys
*
Creating a new index
*
File status conversion
* Data Compression
* Relative Byte Addressing
* File-name mapping (DOS, Windows and OS/2)
* C-ISAM features (UNIX)
You can incorporate this functionality by setting up your own file
definitions and calling the file handler directly, or by using the FCDREG
Compiler directive to gain access to the definitions of files defined
using COBOL syntax.
MPE/iX 5.0 Documentation