Back to Blog
January 30, 20267 min readVisual Reverse Engineering

Visual Reverse Engineering for AS/400: Bringing Green Screens into the 21st Century

R
Replay Team
Developer Advocates

Your most critical business logic is currently trapped inside a 5250 emulator, written in RPG or COBOL by engineers who retired five years ago. This is the AS/400 (IBM i) dilemma: the system is too reliable to turn off, yet too opaque to evolve. While these "green screens" power global supply chains and financial ledgers, they represent a significant portion of the $3.6 trillion global technical debt. The traditional solution—a "Big Bang" rewrite—is a career-ending gamble that fails 70% of the time.

The alternative isn't another decade of maintenance; it’s Visual Reverse Engineering. By treating the user interface as the primary source of truth, we can extract business intent and move from a black box to a documented, modern codebase in weeks, not years.

TL;DR: Visual Reverse Engineering bypasses the "archaeology phase" of AS/400 modernization by recording live user workflows and automatically generating documented React components, API contracts, and E2E tests.

The Archaeology Trap: Why AS/400 Rewrites Fail#

Most modernization attempts begin with "code archaeology." Teams spend months—sometimes years—digging through millions of lines of legacy RPG or COBOL code to understand business rules. This is where the 18-24 month timeline originates.

The problem is that 67% of legacy systems lack any meaningful documentation. When you try to rewrite from the code level up, you aren't just translating syntax; you are trying to rediscover business logic that has been buried under decades of patches.

ApproachTimelineRiskCostDocumentation
Big Bang Rewrite18-24 monthsHigh (70% fail)$$$$Manual/Post-hoc
Strangler Fig12-18 monthsMedium$$$Partial
Manual Migration40 hrs / screenHigh$$Inconsistent
Visual Reverse Engineering (Replay)2-8 weeksLow$Automated/Real-time

Visual Reverse Engineering flips the script. Instead of looking at the code, we look at the execution. By recording a real user performing a workflow—like processing an insurance claim or a warehouse pick-list—Replay captures the state changes, data inputs, and UI patterns. It transforms the "what the user does" into "what the code must do."

From Black Box to React: The Extraction Workflow#

The goal of modernizing an AS/400 system is rarely to just "make it web-based." It’s to decouple the business logic from the legacy infrastructure. Replay facilitates this by generating clean, modular React components directly from the recorded 5250 sessions.

Step 1: Workflow Recording#

An expert user performs a standard task within the legacy system. Replay records the screen state, the data transit, and the underlying DOM (or terminal equivalent) interactions. This becomes the "source of truth."

Step 2: Visual Analysis & Component Mapping#

Replay’s AI Automation Suite analyzes the recording. It identifies patterns—subfiles become data grids, command keys (F3, F12) become navigation hooks, and input fields become controlled components.

Step 3: Code Generation#

The system generates a modern React component. This isn't "spaghetti code" generated by a transpiler. It is clean, TypeScript-ready code that follows your organization's design system (managed in the Replay Library).

typescript
// Example: React component extracted from an AS/400 Subfile grid import React, { useState, useEffect } from 'react'; import { DataGrid, Button, Alert } from '@enterprise/design-system'; import { useLegacyBridge } from '../hooks/useLegacyBridge'; interface OrderRow { id: string; customerName: string; orderDate: string; status: 'PENDING' | 'SHIPPED' | 'CANCELLED'; } export const OrderManagementModule: React.FC = () => { const { data, loading, error, executeAction } = useLegacyBridge<OrderRow[]>('/api/v1/orders'); // Business logic preserved: AS/400 'F21' Print functionality const handlePrint = async (orderId: string) => { await executeAction('PRINT_ORDER', { orderId }); }; if (error) return <Alert severity="error">Legacy System Connection Failed</Alert>; return ( <div className="p-6"> <h2 className="text-2xl font-bold mb-4">Order Management (System i Migrated)</h2> <DataGrid loading={loading} rows={data} columns={[ { field: 'id', headerName: 'Order #' }, { field: 'customerName', headerName: 'Customer' }, { field: 'status', headerName: 'Status' }, { field: 'actions', renderCell: (params) => ( <Button onClick={() => handlePrint(params.row.id)}>Print (F21)</Button> ) } ]} /> </div> ); };

💡 Pro Tip: When modernizing AS/400, focus on "High-Value, High-Pain" screens first. Use Replay to extract the 20% of screens that handle 80% of the daily transactions.

Solving the Documentation Gap#

One of the most dangerous aspects of legacy systems is the "tribal knowledge" required to operate them. When the documentation is missing, the only people who know how the system works are the users.

Replay converts these user actions into technical documentation automatically. For every workflow recorded, it generates:

  1. API Contracts: Defining exactly what data the modern frontend needs from the legacy backend.
  2. E2E Tests: Ensuring that the new React interface behaves exactly like the original green screen.
  3. Technical Debt Audit: Identifying redundant fields and deprecated logic paths that don't need to be migrated.

💰 ROI Insight: Manual documentation and screen mapping take an average of 40 hours per screen. Replay reduces this to 4 hours, representing a 90% reduction in labor costs for the discovery phase.

Security and Compliance in Regulated Environments#

For industries like Financial Services and Healthcare, "cloud-only" isn't always an option. Legacy AS/400 systems often house sensitive PII or PHI. Modernizing these systems requires a platform that respects strict regulatory boundaries.

Replay is built for these environments. With SOC2 compliance and HIPAA-ready protocols, it ensures that during the recording and extraction process, sensitive data is handled according to enterprise standards. For organizations with extreme data sovereignty requirements, Replay offers On-Premise deployment, allowing the entire reverse engineering process to happen within your firewall.

⚠️ Warning: Never attempt a legacy migration without a validated E2E test suite. Without "bit-for-bit" verification of business logic, you risk silent data corruption in your core ledgers.

The Path to Modernization: A 3-Step Tutorial#

Step 1: Assessment and Flow Identification#

Identify the "Flows" within your AS/400 environment. Use Replay to map out the architecture of the legacy application. Instead of looking at thousands of RPG members, you look at a visual map of how users navigate the system.

Step 2: Recording and Blueprinting#

Record the workflows. Replay creates a "Blueprint"—a visual editor where architects can refine the extracted logic. This is where you decide which legacy quirks to keep and which to modernize (e.g., replacing a multi-step command sequence with a single button click).

Step 3: Automated Extraction and Integration#

Export the generated React components and API definitions. Integrate them into your modern CI/CD pipeline. Because Replay has already generated the documentation and tests, your QA team can validate the migration in days rather than months.

Frequently Asked Questions#

How does Replay handle complex AS/400 Subfiles?#

Replay recognizes the patterns of subfile grids (the standard list view in IBM i). It extracts the column headers, data types, and the "Option" column logic (e.g., 2=Change, 4=Delete, 5=Display) and maps them to modern RESTful actions or React state changes.

Can we modernize without changing the DB2 backend?#

Absolutely. Replay focuses on the presentation and application layers. You can continue to use your DB2 database as the source of truth while providing a modern, React-based interface for your users. This "Strangler Fig" approach reduces risk by keeping the data layer stable.

What is the average time savings compared to manual rewrites?#

Our enterprise partners see an average of 70% time savings. A project that was slated for 18 months of manual development can typically be completed in under 6 months using Visual Reverse Engineering.

Does this require access to the original RPG/COBOL source code?#

No. While having the source code is helpful for deep backend logic, Replay's Visual Reverse Engineering works by analyzing the output and interaction layers. This is critical for systems where the source code has been lost or is no longer maintainable.


Ready to modernize without rewriting? Book a pilot with Replay - see your legacy screen extracted live during the call.

Ready to try Replay?

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

Launch Replay Free