Back to Blog
February 21, 2026 min readmodernization mapping legacy green

IBM i DB2 Modernization: Mapping Legacy Green Screen UI to Modern API Layers

R
Replay Team
Developer Advocates

IBM i DB2 Modernization: Mapping Legacy Green Screen UI to Modern API Layers

Your IBM i (AS/400) environment is likely the most reliable piece of infrastructure in your data center, yet it is also the most significant bottleneck to your digital transformation. The "green screen" 5250 interface, while efficient for power users, represents a massive disconnect from the modern RESTful architectures required by today's web and mobile applications. According to Replay’s analysis, the primary reason 70% of legacy rewrites fail or exceed their timelines is the sheer complexity of translating these monolithic UI workflows into modular, API-driven components.

The challenge isn't just the database; it’s the logic trapped within the display files (DDS) and the RPG/COBOL programs that drive them. To move forward, organizations must master modernization mapping legacy green screens to semantic, structured data layers without losing the decades of business logic baked into the system.

TL;DR:

  • The Problem: IBM i systems are reliable but their 5250 UIs are incompatible with modern web architectures.
  • The Solution: Use Visual Reverse Engineering to map legacy UI fields directly to React components and API schemas.
  • Key Metric: Manual screen-to-code conversion takes ~40 hours per screen; Replay reduces this to ~4 hours.
  • Strategy: Don't rewrite the database first; map the UI workflows to modern API layers to provide immediate value.

The Core Challenges of Modernization Mapping Legacy Green Screens#

When you look at a standard IBM i "Work with Members" or "Customer Inquiry" screen, you aren't just looking at data; you are looking at a stateful session. Unlike modern stateless web apps, the IBM i maintains a constant connection where the cursor position, function keys (F1-F24), and "indicators" dictate program flow.

Industry experts recommend focusing on the "Mapping Layer"—the bridge between the 5250 data stream and your modern frontend. However, this is where most teams hit a wall.

Visual Reverse Engineering is the process of recording real user workflows and automatically converting those visual patterns into documented React components and API definitions. By using Replay, architects can bypass the manual documentation phase—a critical advantage since 67% of legacy systems lack any up-to-date documentation.

The $3.6 Trillion Technical Debt Problem#

The global technical debt has ballooned to $3.6 trillion, much of it sitting in systems like the IBM i. For a typical enterprise, a full rewrite takes an average of 18 months. By focusing on modernization mapping legacy green interfaces to modern components, you can reduce this timeline from years to weeks.

FeatureManual ModernizationReplay Visual Reverse Engineering
Time per Screen40+ Hours4 Hours
DocumentationManual/IncompleteAuto-generated Blueprints
Error RateHigh (Manual Mapping)Low (AI-Assisted Extraction)
Skillset RequiredRPG + React + ArchitectBusiness Analyst + React
CostHigh (18-24 months)Low (Weeks/Months)

Step 1: Capturing the 5250 Workflow#

Before you can map anything, you need to understand the "Flow." On an IBM i, a single business process (like "Enter Sales Order") might span 12 different screens, including pop-up windows and subfiles.

Instead of reading legacy RPG source code—which is often undocumented and convoluted—you should record the actual workflow. Replay allows you to record these sessions. As the user navigates the green screen, Replay captures the field positions, lengths, and data types.

Modernization mapping legacy green starts with identifying "Subfiles." In the IBM i world, a subfile is a list of records. In the modern world, this is a Data Grid or an HTML Table.

Defining the Data Schema#

When Replay records a screen, it recognizes that

text
Row 5, Column 10
with a length of 10 is actually
text
Customer_ID
. It then generates a JSON schema that represents that screen’s state.

typescript
// Example: Generated Schema for a Legacy Customer Inquiry Screen interface LegacyCustomerInquiry { header: { screenId: string; // e.g., "CUST001R" title: string; // "Customer Master Inquiry" systemDate: string; }; fields: { customerId: string; customerName: string; creditLimit: number; currentBalance: number; statusIndicator: 'A' | 'I'; // Active/Inactive }; actions: { f3: "Exit"; f5: "Refresh"; f12: "Cancel"; }; }

Step 2: Modernization Mapping Legacy Green Fields to RESTful APIs#

Once you have the schema, you need to map these fields to a modern API layer. This layer acts as a "Sidecar" to your IBM i. It talks to the DB2 database (via JDBC or SQL) but serves JSON to your React frontend.

The difficulty in modernization mapping legacy green is handling the "Indicators." In RPG, an indicator (like

text
*IN35
) might mean "Display field in red" or "Field is protected."

According to Replay's analysis, mapping these visual cues to semantic React props is the most time-consuming part of manual modernization. Replay automates this by creating "Blueprints"—visual maps that link legacy screen attributes to modern UI properties.

Building the API Bridge#

You don't want your React app to know about "Row 5, Column 10." You want it to know about

text
customerName
. Your API layer should perform this translation.

typescript
// TypeScript Service for Mapping Legacy DB2 Data to Modern UI export class CustomerService { async getCustomerDetails(id: string): Promise<ModernCustomerRecord> { // Call to legacy system or DB2 via a bridge const rawData = await db2Provider.execute('SELECT * FROM CUSTMAST WHERE CID = ?', [id]); // Modernization mapping legacy green: Transforming flat DB2 fields to structured JSON return { id: rawData.CID.trim(), fullName: rawData.CNAME.trim(), financials: { limit: rawData.CLIMIT, balance: rawData.CBAL, isOverLimit: rawData.CBAL > rawData.CLIMIT }, status: rawData.CSTAT === 'A' ? 'active' : 'inactive' }; } }

For more on how to structure these bridges, see our guide on Legacy Modernization Strategies.


Step 3: Generating the React Component Library#

The end goal of modernization mapping legacy green screens is a functional, beautiful React application. With Replay’s Library, the recording of your green screen is automatically converted into a documented React component.

Video-to-code is the process of using recorded user sessions to automatically derive architectural patterns, data structures, and front-end components from legacy software.

Instead of a developer spending 40 hours building a "Customer Table" component that mimics the legacy subfile behavior, Replay generates it in minutes. This includes the logic for pagination (handling the "Page Down" key) and record selection.

Example: The Modernized Component#

The following React component is a simplified version of what Replay generates from a legacy IBM i subfile recording.

tsx
import React from 'react'; import { DataTable, StatusBadge } from './design-system'; interface CustomerTableProps { data: ModernCustomerRecord[]; onSelect: (id: string) => void; } const CustomerTable: React.FC<CustomerTableProps> = ({ data, onSelect }) => { return ( <div className="p-6 bg-white rounded-lg shadow-md"> <h2 className="text-xl font-bold mb-4">Customer Records</h2> <DataTable columns={[ { header: 'ID', accessor: 'id' }, { header: 'Name', accessor: 'fullName' }, { header: 'Balance', accessor: 'financials.balance', type: 'currency' }, { header: 'Status', accessor: 'status', render: (val) => <StatusBadge type={val === 'active' ? 'success' : 'error'} /> } ]} data={data} onRowClick={(row) => onSelect(row.id)} /> </div> ); }; export default CustomerTable;

By automating the UI generation, you ensure that the Design System remains consistent across the entire enterprise, even as you modernize hundreds of legacy screens.


Step 4: Handling State and Navigation#

One of the biggest hurdles in modernization mapping legacy green is navigation. In a 5250 session, navigation is linear and stateful. You can't just "bookmark" a page or use the "Back" button.

When you use Replay Flows, the platform maps the transitions between screens. It understands that pressing

text
F6
on the "Customer List" screen leads to the "Add Customer" screen. Replay converts these transitions into a modern React Router or Next.js navigation structure.

The "Flow" Architecture#

Industry experts recommend a "headless" approach to IBM i modernization. The legacy system remains the "Source of Truth" for data, but the "Flow Logic" is moved to a modern middleware or the frontend.

  1. Capture: Use Replay to record every possible path through the legacy UI.
  2. Analyze: Replay's AI Automation Suite identifies redundant steps and optimizes the flow.
  3. Implement: The generated React code uses modern state management (like Redux or React Query) to handle the data that was previously trapped in the 5250 session memory.

Security and Compliance in Regulated Environments#

Modernizing IBM i systems often happens in highly regulated industries like Financial Services, Healthcare, and Government. You cannot afford to leak PII (Personally Identifiable Information) during the modernization mapping legacy green process.

Replay is built for these environments:

  • SOC2 & HIPAA-ready: Ensuring your data remains protected.
  • On-Premise Availability: For organizations that cannot use cloud-based modernization tools, Replay can be deployed within your own firewall.
  • Audit Trails: Every mapping and generated component is documented, providing a clear trail from the legacy screen to the new code.

Why Visual Reverse Engineering Beats Manual Rewriting#

The traditional approach to modernization mapping legacy green involves hiring a team of consultants to sit with users, write requirements, and then have developers try to recreate the logic in a new language. This is why the average enterprise rewrite takes 18 months and often fails.

With Replay, you are not guessing. You are extracting the truth directly from the UI.

  1. Accuracy: You are mapping exactly what the user sees and does.
  2. Speed: You eliminate the "Requirement Translation" phase.
  3. Documentation: You solve the "67% lack of documentation" problem instantly.

According to Replay's analysis, companies using Visual Reverse Engineering see a 70% average time savings compared to traditional manual modernization efforts.


Frequently Asked Questions#

Does modernization mapping legacy green require changes to my RPG code?#

No. One of the primary benefits of using Replay for modernization mapping legacy green is that it works by observing the UI layer. You can build a modern React frontend and API layer without touching a single line of legacy RPG or COBOL code, reducing the risk of breaking core business logic.

How does Replay handle complex IBM i subfiles with multiple pages?#

Replay's AI Automation Suite recognizes the patterns of subfile navigation (like "Page Down" or "Roll Up" indicators). It maps these legacy pagination commands to modern API parameters, allowing your new React application to handle large datasets through standard RESTful pagination or infinite scrolling.

Is it possible to modernize only specific workflows instead of the whole system?#

Yes, this is the recommended approach. Industry experts recommend a "Strangler Pattern" for IBM i modernization. You can use Replay to map and modernize your most critical or high-traffic workflows first (like Customer Entry), while leaving less-used administrative screens in the green screen format until they are needed.

What happens if the legacy DB2 schema is messy?#

Legacy DB2 tables often have cryptic column names (e.g.,

text
CMST_01
instead of
text
CustomerName
). During the modernization mapping legacy green process, Replay's Blueprints allow you to provide semantic aliases. This ensures that the generated React code and API layers use clean, readable naming conventions that modern developers can understand.

Can Replay be used for Mainframe (z/OS) systems as well?#

Absolutely. While this guide focuses on IBM i (AS/400), the principles of Visual Reverse Engineering apply to any terminal-based system, including TN3270 Mainframe environments. You can record workflows and generate modern React components regardless of the underlying legacy hardware.


Conclusion: The Path to a Modern IBM i Ecosystem#

The $3.6 trillion technical debt crisis won't be solved by manual rewrites. The only way to move at the speed of business is to automate the extraction of logic from legacy systems. By focusing on modernization mapping legacy green screens through Visual Reverse Engineering, you can transform your IBM i from a "black box" into a high-performance data source for your modern React ecosystem.

Stop wasting 40 hours per screen on manual mapping. Transition from 18-month timelines to delivery in weeks.

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