External File Handler (ExtFH) Directives & Configuration (extfh.cfg)
When COBOL applications perform file I/O operations (OPEN, READ, WRITE, REWRITE), the underlying operations are handled by the Callable File Handler (ExtFH). In mainframe rehosting and distributed modernization projects, applications frequently encounter operational and environmental differences—such as strict 32-bit file size barriers (the 2 GB / 4 GB limit on legacy indexed files), differing indexed file formats between operating systems, path structure changes, or multi-user file contention. [1]
Read the full briefing
1. What It Is & The Problem It Solves
When COBOL applications perform file I/O operations (OPEN, READ, WRITE, REWRITE), the underlying operations are handled by the Callable File Handler (ExtFH). In mainframe rehosting and distributed modernization projects, applications frequently encounter operational and environmental differences—such as strict 32-bit file size barriers (the 2 GB / 4 GB limit on legacy indexed files), differing indexed file formats between operating systems, path structure changes, or multi-user file contention.
Modifying application source code or recompiling hundreds of programs simply to adjust physical file properties, enable compression, or tune record locking is error-prone and unscalable. Rocket’s External File Handler configuration file (extfh.cfg) decouples runtime file handling behavior from application source code (Configuration File - Rocket Software Documentation). Through declarative rules, administrators and developers can globally or selectively modify indexing formats, compression algorithms, directory mappings, and concurrency controls at runtime without changing a single line of COBOL code.
2. Practical Development & Runtime Architectural Advantages
- Large File Support Beyond 4 GB (
IDXFORMAT 8): Legacy indexed file formats (IDXFORMAT 3or4) are constrained by 32-bit addressing to 2 GB or 4 GB. By declaringIDXFORMAT=8inextfh.cfg, the runtime engine provisions 64-bit file addressing and pointer architectures, allowing files to expand up to 2 Exabytes without requiring application schema or code restructuring (File Handling - Rocket Software Documentation). - Granular Per-File vs. Global Scoping: The configuration uses section headers to balance wide standards with surgical overrides:
[XFH-DEFAULT]: Sets global baseline defaults across all files processed by the file handler.[filename.dat]or[tag-name]: Overrides defaults for a specific file (e.g., enabling aggressive compression on high-volume audit logs while leaving latency-sensitive reference tables uncompressed).
- Seamless Redirection to Fileshare (
FHREDIR): Instead of replacingCALL "EXTFH"withCALL "FHREDIR"in legacy procedural code, settingFHREDIR=ONinextfh.cfgdirects the file handler to intercept local I/O calls and automatically route them across the network to a central Fileshare server (Using the File Handling Redirector Module). - Data and Key Compression: Setting
DATACOMPRESSandKEYCOMPRESSoptions significantly reduces disk storage footprints and network transmission sizes for indexed files with repetitive data fields or dense key structures.
3. Key Syntax, Environment Variables & Configuration Snippets
- Environment Variable Configuration: By default, ExtFH searches for
extfh.cfgin the current working directory (or$COBDIR/etcon UNIX /%COBDIR%\etcon Windows). To designate a custom location across an enterprise region or script, set theEXTFHenvironment variable (Configuration File - Rocket Software Documentation):
EXTFH=/etc/microfocus/extfh.cfg
export EXTFH- Declarative
extfh.cfgSyntax:
# Global configuration applied to all files
[XFH-DEFAULT]
idxformat=8
filemaxsize=8
filepointersize=8
datacompress=0
keycompress=0
# Specific tuning for large transactional master dataset
[CUSTOMER.DAT]
idxformat=8
datacompress=3
keycompress=7
fileprefix=/data/production/vsam/
# Concurrency configuration for batch processing file
[TRANS_LOG.DAT]
ignorelock=on- Compiler Directive Alternative: While
extfh.cfgallows external runtime modifications, default creation formats can also be established during compilation via directives such asIDXFORMAT"8"orCALLFH"FHREDIR"(File Handling - Rocket Software Documentation, Using the File Handling Redirector Module).
4. Reference Citations (Rocket Documentation 12.0)
- Configuration File - Rocket Software Documentation — Enterprise Server 12.0 for UNIX
- Configuration File - Rocket Software Documentation — Enterprise Server 12.0 for Windows
- File Handling - Rocket Software Documentation — Enterprise Server 12.0 for UNIX
- Using the File Handling Redirector Module — Enterprise Server 12.0 for UNIX
5. Mem0 Memory Indexing Confirmation
This technical insight has been indexed into Mem0:
- Memory ID:
b7d92d3f-0066-4852-a38d-55a760709efc - Topic: External File Handler & extfh.cfg
- Category: Data Tier - File Handling & Directives
- Scope / Domain:
developer/rocket-enterprise-suite(v12.0)