COBOL Screen Logic Recovery: How to Document 30 Years of Undocumented Workflows
Your core business logic isn't residing in a clean Git repository or a well-commented microservice; it is trapped inside a 1988 CICS green screen that only three people in your building know how to navigate—and two of them are retiring next quarter. This is the "black box" reality of the $3.6 trillion global technical debt. For decades, mission-critical workflows in insurance, banking, and government have been buried in COBOL (Common Business-Oriented Language) systems where the UI and the logic are inextricably linked.
When the source code is a spaghetti-tangle of
GO TOBMSTL;DR:
- •The Problem: 70% of legacy rewrites fail because the underlying screen logic is undocumented and inaccessible.
- •The Solution: COBOL screen logic recovery through Visual Reverse Engineering.
- •The Impact: Replay reduces modernization timelines from 18 months to weeks, saving 70% of the effort by converting video recordings of workflows into documented React code.
- •Efficiency: Manual screen documentation takes ~40 hours per screen; Replay reduces this to 4 hours.
The Documentation Gap: Why Traditional Extraction Fails#
Standard static analysis tools attempt to read COBOL source code to determine business rules. However, in the context of COBOL screen logic recovery, static analysis often misses the "human element"—the specific sequence of keystrokes, hidden field dependencies, and the "tribal knowledge" required to move from one screen to the next.
COBOL Screen Logic Recovery is the systematic process of extracting, documenting, and recreating the functional behavior and UI constraints of legacy mainframe interfaces into modern architectures.
According to Replay's analysis, the primary reason for the failure of these projects is the "Semantic Gap." A developer can look at a COBOL
DATA DIVISIONPIC X(10)The Cost of Manual Recovery#
Historically, architects have relied on manual "screen scraping" or developer interviews. This is a recipe for disaster.
| Feature | Manual Documentation | Replay (Visual Reverse Engineering) |
|---|---|---|
| Time per Screen | 40+ Hours | 4 Hours |
| Accuracy | Subject to human error/omission | 100% visual fidelity |
| Documentation Type | Static PDFs/Word Docs | Interactive React Components & Flow Maps |
| Knowledge Transfer | Dependent on retiring SMEs | Automated AI-driven insights |
| Cost | High ($250k+ per module) | 70% reduction in TCO |
The Technical Challenges of COBOL Screen Logic Recovery#
To perform effective COBOL screen logic recovery, one must understand the three layers of a legacy terminal interface:
- •The Presentation Layer (BMS Maps): This defines where fields are located on the 24x80 character grid.
- •The Field Attributes: COBOL screens use "Attribute Bytes" to control visibility, protection (read-only), and intensity. Much of the "logic" is actually hidden in these bytes.
- •The Transactional Flow: How data persists across multiple screens (COMMAREA or TSQ - Temporary Storage Queues).
Industry experts recommend moving away from "code-first" extraction toward "behavior-first" extraction. If you cannot see the workflow in action, you cannot accurately document it. This is where Visual Reverse Engineering becomes the superior path.
The "Hidden Logic" Problem#
Consider a standard COBOL validation. The code might check if a field is numeric, but the user experience of that error—how the cursor moves, which fields turn red, and which subsequent fields are locked—is rarely documented in the source code effectively. By recording a real user performing these tasks, Replay captures the "As-Is" state with perfect precision.
Automating COBOL Screen Logic Recovery with Replay#
Replay changes the paradigm from manual analysis to automated recovery. Instead of reading 10,000 lines of COBOL to understand a single screen, you record a video of the workflow.
Video-to-code is the process of using computer vision and AI to transform a video recording of a legacy UI into functional, structured code and design systems.
Step 1: Record the Workflow#
A subject matter expert (SME) records a session of them completing a standard task (e.g., "Onboard New Policyholder"). Replay captures every frame, every state change, and every terminal interaction.
Step 2: AI-Powered Component Extraction#
The Replay AI Automation Suite analyzes the recording. It identifies recurring UI patterns—input fields, tables, action buttons—and maps them to a centralized Library (Design System).
Step 3: Generating the Modern Stack#
Instead of a "black box" migration, Replay generates clean, documented React components. Here is an example of how a legacy COBOL field validation is recovered and transformed into a modern TypeScript/React equivalent.
Example: COBOL Logic vs. Recovered React Code
Legacy COBOL (Conceptual):
cobolIF CLAIM-AMOUNT > 5000 MOVE 'CLAIM REQUIRES SUPERVISOR' TO ERR-MSG MOVE DFHBMBRY TO CLAIM-ATTR EXEC CICS SEND MAP('CLAIM-MAP') END-EXEC.
Recovered React Component (Generated by Replay):
typescriptimport React from 'react'; import { useForm } from 'react-hook-form'; import { Alert, TextField, Button } from '@/components/ui'; interface ClaimFormProps { initialData?: any; onApprovalRequired: () => void; } export const ClaimEntry: React.FC<ClaimFormProps> = ({ initialData, onApprovalRequired }) => { const { register, watch, formState: { errors } } = useForm({ defaultValues: initialData }); const claimAmount = watch('claimAmount'); // Replay automatically identified this logic from the recorded workflow const isSupervisorRequired = claimAmount > 5000; return ( <div className="p-6 space-y-4"> <TextField label="Claim Amount" {...register('claimAmount', { required: true })} error={!!errors.claimAmount} /> {isSupervisorRequired && ( <Alert variant="warning"> Claim requires supervisor approval based on legacy business rule. </Alert> )} <Button type="submit">Process Claim</Button> </div> ); };
Mapping the "Architecture of Flows"#
One of the most complex parts of COBOL screen logic recovery is understanding the "Flow"—the navigation path between dozens of different screens. In a mainframe environment, these are often "conversational" or "pseudo-conversational" transactions.
Replay's Flows feature automatically generates a visual architecture map of the legacy system. As you record different parts of the application, Replay stitches them together into a comprehensive technical blueprint. This eliminates the 18-month average enterprise rewrite timeline by providing a "map of the territory" before a single line of new code is written manually.
The Benefits of a Visual Blueprint#
- •Identify Dead Ends: Discover screens that are no longer used by the business.
- •Consolidate Workflows: Often, three COBOL screens can be collapsed into a single modern React multi-step form.
- •Gap Analysis: Clearly see where the legacy system lacks modern requirements (like mobile responsiveness or accessibility).
Learn more about mapping legacy flows
Implementing a Design System from Green Screens#
A major hurdle in COBOL screen logic recovery is the lack of a consistent design language. Mainframe apps are functional, not beautiful. However, they do have a logic to their layout.
According to Replay's analysis, legacy screens often follow a strict "Grid System" that can be mapped to modern CSS Grid or Flexbox layouts. Replay's Blueprints (Editor) allows architects to take the raw extracted components and align them with a modern Design System (like Shadcn/UI or Tailwind) while maintaining the original business logic constraints.
Transforming Terminal Tables to Modern Data Grids#
Mainframe tables are notoriously difficult to modernize because they often use "subfiles" or "paging" logic that is hard-coded into the COBOL program. Replay identifies these repeating patterns and converts them into high-performance React Table components.
typescript// Replay-generated Data Grid from Legacy Subfile import { ReplayTable } from '@replay-build/core'; const PolicyTable = ({ data }) => { const columns = [ { header: 'Policy ID', accessorKey: 'policyId' }, { header: 'Status', accessorKey: 'status' }, { header: 'Effective Date', accessorKey: 'effDate' }, ]; return ( <ReplayTable columns={columns} data={data} pagination={true} // Replay identified the legacy 'PF7/PF8' paging logic and mapped it to standard pagination onPageChange={(page) => handleLegacyPaging(page)} /> ); };
Security and Compliance in Regulated Industries#
For sectors like Financial Services and Healthcare, COBOL screen logic recovery cannot happen in a vacuum. Data privacy is paramount. Replay is built for these high-stakes environments, offering:
- •SOC2 & HIPAA Readiness: Ensuring that recorded PII (Personally Identifiable Information) can be masked during the recovery process.
- •On-Premise Deployment: For organizations that cannot send their legacy logic to the cloud, Replay offers a fully air-gapped solution.
- •Audit Trails: Every component generated is linked back to the original recording, providing a "Source of Truth" for compliance auditors.
Read about our security protocols
The Strategic Path Forward: Modernize Without Rewriting#
The "Big Bang" rewrite is dead. The risk of losing 30 years of nuanced business logic is too high. Instead, enterprise architects are choosing a "Visual First" approach. By focusing on COBOL screen logic recovery, you preserve the value of the legacy system while moving it to a modern, maintainable stack.
Industry experts recommend a three-phase approach:
- •Discovery: Use Replay to record all critical workflows.
- •Documentation: Generate the Library and Flow maps automatically.
- •Execution: Use the generated React components as the foundation for the new application, saving up to 70% of development time.
Frequently Asked Questions#
What is COBOL screen logic recovery?#
It is the process of extracting the functional rules, field validations, and workflow transitions from legacy mainframe terminal screens (like CICS or IMS) and documenting them in a format that modern developers can use to rebuild the system in React, Angular, or Vue.
How does Replay handle missing source code?#
One of the primary advantages of Replay is that it uses Visual Reverse Engineering. Because it analyzes the behavior of the application through video recordings, it can document and recreate the logic even if the original COBOL source code is lost, corrupted, or undocumented.
Can Replay handle complex multi-screen transactions?#
Yes. Through its "Flows" feature, Replay tracks how data moves between different screens and transaction codes. It captures the state transitions and maps them to modern state management patterns (like Redux or React Context), ensuring that complex business processes are preserved during modernization.
Is the generated React code "production-ready"?#
Replay generates high-quality, documented TypeScript/React code that follows modern best practices. While some business logic might require fine-tuning, it provides a 70-80% starting point, significantly accelerating the development cycle compared to manual coding from scratch.
How long does a typical recovery project take with Replay?#
While a manual rewrite of a legacy module can take 18-24 months, organizations using Replay typically see a documented, functional component library and flow map within weeks. The average time savings is roughly 70% of the total project duration.
Ready to modernize without rewriting? Book a pilot with Replay