Back to Blog
February 18, 2026 min readlegacy cobol wrappers using

Legacy COBOL UI Wrappers: Using Visual Evidence to Build Modern Frontends

R
Replay Team
Developer Advocates

Legacy COBOL UI Wrappers: Using Visual Evidence to Build Modern Frontends

COBOL isn't dying; it is just trapped. Behind every "green screen" terminal emulator in the financial services and insurance sectors lies a logic engine that has survived decades of market volatility. The problem isn't the COBOL code itself—which is often remarkably stable—but the interface that hides it. When we talk about legacy cobol wrappers using modern web frameworks, we aren't just talking about aesthetic upgrades; we are talking about the survival of the enterprise.

The traditional approach to modernization is a binary choice: the "Big Bang" rewrite or "Screen Scraping." Both are fundamentally flawed. According to Replay’s analysis, 70% of legacy rewrites fail or significantly exceed their timelines because they underestimate the "hidden logic" embedded in the UI. When 67% of legacy systems lack up-to-date documentation, the UI is the only source of truth left.

TL;DR: Modernizing mainframe systems requires more than just API wrappers; it requires a visual-first approach. By recording user workflows, Replay converts legacy COBOL screens into documented React components and design systems. This "Visual Reverse Engineering" cuts modernization timelines from years to weeks, achieving a 70% average time savings by automating the documentation and component creation process.

Building Legacy COBOL Wrappers Using Visual Evidence#

The core challenge of wrapping a COBOL-based system is the "Documentation Vacuum." In a typical Tier-1 bank, the original architects of the core banking system have long since retired. The requirements documents are either lost or reflect a version of the software that existed in 1994.

Industry experts recommend moving away from manual requirement gathering. Instead, architecting legacy cobol wrappers using visual evidence—actual recordings of power users navigating the system—allows teams to capture "tribal knowledge" that isn't in the code.

Visual Reverse Engineering is the process of capturing real-time user interactions with a legacy interface and programmatically translating those visual patterns into modern code structures, documentation, and architectural flows.

The Problem with Manual Mapping#

When a developer manually maps a COBOL 3270 screen to a React component, they spend an average of 40 hours per screen. This includes identifying field lengths, validation rules (often hidden in the terminal's behavior), and navigation logic.

Replay changes this math. By recording the workflow, Replay's AI Automation Suite identifies the recurring patterns in the legacy UI. It doesn't just see a "text box"; it sees a "Customer ID Field" with specific masking and length constraints, then generates the corresponding React code.

Learn more about our AI Automation Suite

Challenges in Scaling Legacy COBOL Wrappers Using Manual Methods#

The global technical debt currently sits at a staggering $3.6 trillion. A significant portion of this is locked in mainframe environments where the cost of change is prohibitively high. When teams attempt to build legacy cobol wrappers using manual methods, they hit three walls:

  1. State Management Complexity: COBOL applications are often stateful in ways modern REST APIs struggle to replicate. A wrapper must maintain the session state across multiple terminal screens.
  2. The "Invisible" Logic: Many COBOL screens use specific function keys (F1-F12) to trigger background processes. If these aren't captured in the wrapper, the modern frontend will lack critical functionality.
  3. The Timeline Trap: The average enterprise rewrite takes 18 months. In that time, business requirements change, rendering the new system obsolete before it launches.

Comparison: Manual vs. Replay-Driven Modernization#

MetricManual Wrapper DevelopmentReplay Visual Reverse Engineering
Time per Screen40 Hours4 Hours
Documentation Accuracy40-60% (Human error)99% (Based on visual evidence)
Average Project Timeline18-24 Months2-4 Months
Success Rate30%85%+
CostHigh ($$$)Low ($)

Implementing the Wrapper: From Terminal to TypeScript#

To build effective legacy cobol wrappers using modern stacks, you need a middle layer that can translate terminal protocols (like TN3270) into JSON/REST, while the frontend consumes a standardized component library.

Below is a conceptual example of how a legacy COBOL "Policy Search" screen is mapped to a modern React component using a pattern generated by Replay.

Step 1: Defining the Legacy Schema#

First, we define the visual fields captured from the recording. Replay identifies these coordinates and attributes automatically.

typescript
// Generated by Replay Blueprints interface LegacyPolicyScreen { fields: { policyNumber: { row: 5, col: 20, length: 10, type: 'ALPHANUMERIC' }; effectiveDate: { row: 6, col: 20, length: 8, type: 'DATE' }; status: { row: 7, col: 20, length: 1, type: 'PROTECTED_STRING' }; }; actions: { submit: 'ENTER'; cancel: 'PF3'; details: 'PF12'; }; }

Step 2: Generating the React Component#

Once the schema is defined, Replay's Library exports a documented React component that matches the enterprise design system.

tsx
import React from 'react'; import { useLegacyWrapper } from '@replay-internal/core-hooks'; import { TextField, Button, Alert } from '@enterprise-ds/ui-kit'; /** * PolicySearchComponent * Modernized from Mainframe Screen: POL-SRCH-01 * Visual Evidence ID: 882-AF-99 */ export const PolicySearch: React.FC = () => { const { sendCommand, data, loading, error } = useLegacyWrapper('POL-SRCH-01'); const handleSearch = (values: any) => { // Maps modern UI action to legacy PF key sequence sendCommand('ENTER', { POLICY_NUM: values.policyNumber, EFF_DATE: values.effectiveDate }); }; return ( <div className="p-6 bg-white rounded-lg shadow-md"> <h2 className="text-xl font-bold mb-4">Policy Search</h2> <form onSubmit={handleSearch}> <TextField label="Policy Number" name="policyNumber" placeholder="Enter 10-digit ID" /> <TextField label="Effective Date" name="effectiveDate" type="date" /> <div className="mt-4 flex gap-2"> <Button type="submit" isLoading={loading}> Search System </Button> <Button variant="secondary" onClick={() => sendCommand('PF3')}> Exit to Menu </Button> </div> </form> {data?.status === 'I' && ( <Alert type="warning" className="mt-4"> Policy is currently INACTIVE in the mainframe. </Alert> )} </div> ); };

The Role of Design Systems in Legacy Evolution#

Modernizing legacy cobol wrappers using a "one-off" approach leads to inconsistent user experiences. Industry experts recommend building a centralized Design System first.

With Replay, you don't just get a screen; you get a Component Library. When you record a workflow in Replay, the platform identifies recurring UI patterns—like tables, modal alerts, or specific data inputs—and groups them. This allows you to build a cohesive Design System that bridges the gap between the mainframe's rigid structure and the web's flexibility.

Read more about building Design Systems from Legacy recordings

Flows and Blueprints: Mapping the Architecture#

One of the most significant hurdles in legacy modernization is understanding the "Flow." In a COBOL application, a user might navigate through seven screens to complete a single transaction.

Replay's Flows feature visualizes these transitions automatically. By analyzing the video recordings, Replay builds a directed graph of the application's architecture. This becomes the blueprint for your new micro-frontend architecture.

Security and Compliance in Regulated Industries#

For Financial Services and Healthcare, "moving to the cloud" isn't as simple as a git push. These environments are heavily regulated. Replay is built for these high-stakes environments, offering:

  • SOC2 & HIPAA Readiness: Ensuring that sensitive data captured during the recording process is redacted or handled according to strict compliance standards.
  • On-Premise Deployment: For organizations that cannot let their legacy UI data leave their private network, Replay can be deployed entirely on-premise.

When deploying legacy cobol wrappers using Replay, security teams can audit the "Visual Evidence" to ensure that no business logic was misinterpreted during the transformation—a level of transparency that manual code rewrites simply cannot offer.

Future-Proofing Legacy COBOL Wrappers Using Visual Reverse Engineering#

The goal of modernization isn't just to put a pretty face on an old system. It is to create a path toward eventual decommissioning of the mainframe logic. By building legacy cobol wrappers using visual reverse engineering, you are effectively documenting the system's behavior in a machine-readable format.

According to Replay's analysis, companies that use visual evidence to document their legacy systems are 4x more likely to successfully migrate to a cloud-native architecture later. The wrapper serves as the "strangler pattern" interface, allowing you to swap out COBOL modules for microservices one at a time without disrupting the end-user.

Key Benefits of the Replay Approach:#

  1. Eliminate Discovery Phases: No more 6-month "discovery" projects. The recording is the discovery.
  2. Instant Documentation: Get a full architectural map of your COBOL flows in days.
  3. Developer Happiness: Developers can work in React and TypeScript instead of trying to decipher 40-year-old COBOL copybooks.

Explore Replay's Visual Reverse Engineering Platform

Frequently Asked Questions#

Does this require access to the COBOL source code?#

No. Replay operates on "Visual Evidence." While having the source code can be helpful, Replay's primary value is in capturing the application's behavior and UI logic from the user's perspective. This is ideal for systems where the source code is lost, undocumented, or too complex to parse manually.

How does Replay handle dynamic mainframe screens?#

Replay's AI Automation Suite uses advanced pattern recognition to identify dynamic elements, such as scrollable lists or conditional fields, within the terminal emulator. It maps these to dynamic React components that can handle varying data loads while maintaining the underlying mainframe's logic.

Is this compatible with SOC2 and HIPAA environments?#

Yes. Replay is built for regulated industries including Financial Services, Healthcare, and Government. We offer SOC2-compliant cloud hosting and fully air-gapped On-Premise installations to ensure that sensitive data remains within your security perimeter.

Can we export the generated code to our existing CI/CD pipeline?#

Absolutely. Replay generates standard React/TypeScript code and documented components that can be exported directly into your existing repositories. The goal is to accelerate your current workflow, not replace it with a proprietary "low-code" silo.

What is the average time savings when using Replay?#

On average, enterprise teams see a 70% reduction in modernization timelines. A process that typically takes 18-24 months can often be completed in a matter of weeks or a few months, depending on the number of screens and complexity of the flows.

Ready to modernize without rewriting? Book a pilot with Replay

Ready to try Replay?

Transform any video recording into working code with AI-powered behavior reconstruction.

Launch Replay Free