Subscribe
THE DAILY DIGEST

The daily edition.

Essential reading from Rocket Enterprise. Straight to the source.

Archived edition
DAILY EDITION1 story· 4 min read

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.

IN FOCUS

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 3 or 4) are constrained by 32-bit addressing to 2 GB or 4 GB. By declaring IDXFORMAT=8 in extfh.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 replacing CALL "EXTFH" with CALL "FHREDIR" in legacy procedural code, setting FHREDIR=ON in extfh.cfg directs 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 DATACOMPRESS and KEYCOMPRESS options 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

  1. Environment Variable Configuration: By default, ExtFH searches for extfh.cfg in the current working directory (or $COBDIR/etc on UNIX / %COBDIR%\etc on Windows). To designate a custom location across an enterprise region or script, set the EXTFH environment variable (Configuration File - Rocket Software Documentation):
EXTFH=/etc/microfocus/extfh.cfg
export EXTFH
  1. Declarative extfh.cfg Syntax:
# 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
  1. Compiler Directive Alternative: While extfh.cfg allows external runtime modifications, default creation formats can also be established during compilation via directives such as IDXFORMAT"8" or CALLFH"FHREDIR" (File Handling - Rocket Software Documentation, Using the File Handling Redirector Module).

4. Reference Citations (Rocket Documentation 12.0)

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)
Rocket Enterprise suite · 12.0 · Mixed product/platform sources
Documentation references
That’s the briefing.You’ve reached the end of this edition.
More editions

From the archive

View all
Sep 29

OpenESQL & Host Compatibility Options (HCO) in Enterprise Developer

Sep 28

Fileshare (Multi-User File Server & Transaction Logging)

Sep 27

CICS Web Services (CWS) & Modern API Integration