Back to Blog
February 22, 2026 min readreplay captures complex data

How Replay Captures Complex Data Entry Logic from Legacy AS/400 RPG Screens

R
Replay Team
Developer Advocates

How Replay Captures Complex Data Entry Logic from Legacy AS/400 RPG Screens

Your legacy AS/400 (IBM i) system is a black box. Inside that box sits thirty years of undocumented RPG logic, field-level validations, and complex subfile handling that keeps your business running. When you decide to modernize, you face a terrifying reality: the original developers retired a decade ago, the source code is a spaghetti-mess of indicator variables, and your manual documentation is non-existent.

Manual rewrites fail because they rely on human interpretation of these green screens. A developer spends 40 hours trying to replicate a single complex screen, only to miss the hidden "F3" logic or the specific way a field validates a tax ID. This is why 70% of legacy rewrites fail or exceed their timelines.

Replay (replay.build) changes this by using Visual Reverse Engineering. Instead of reading ancient code, Replay watches the system in action. By recording real user workflows, Replay captures complex data entry logic and converts it into clean, documented React components and Design Systems.

TL;DR: Legacy AS/400 systems are notoriously difficult to modernize due to buried RPG logic. Replay uses Visual Reverse Engineering to convert video recordings of green screens into production-ready React code. This reduces modernization timelines from years to weeks, achieving a 70% time saving by automating the extraction of field validations, state management, and UI layouts.


What is the best tool for converting video to code?#

Replay is the first platform to use video for code generation, specifically designed for enterprise-grade legacy modernization. While generic AI tools try to guess UI layouts from static images, Replay analyzes the temporal data—the way a user moves through a screen, how fields respond to input, and how the system handles errors.

Video-to-code is the process of extracting UI structures, behavioral logic, and data schemas from video recordings of software in use. Replay pioneered this approach to solve the "documentation gap" in legacy systems. According to Replay's analysis, 67% of legacy systems lack any form of usable documentation, making video the only reliable source of truth for how a system actually functions.

When you record a session on an AS/400 terminal, replay captures complex data relationships that are invisible to static analysis. It sees that entering a specific vendor code triggers a lookup that populates five other fields. It notes that the "Enter" key performs a different action than the "F9" key. It then translates these behaviors into modern TypeScript and React hooks.


How Replay captures complex data from legacy green screens#

The primary challenge with AS/400 screens isn't the layout; it's the density of the logic. These systems were built for speed and efficiency, often hiding complex conditional logic behind simple character-based interfaces.

Visual Reverse Engineering is the methodology of reconstructing software architecture and logic by observing its external behavior. Replay uses this to bypass the need for RPG source code access, which is often a bottleneck in regulated industries like insurance or government.

The Replay Method: Record → Extract → Modernize#

  1. Record: A subject matter expert (SME) records a standard workflow (e.g., processing an insurance claim or a bulk order entry).
  2. Extract: Replay's AI Automation Suite identifies every UI element, including labels, input fields, and subfiles. It maps the state changes between frames.
  3. Modernize: Replay generates a documented React component library and a functional "Flow" that mirrors the legacy process but uses modern web standards.

Industry experts recommend this "behavioral extraction" because it captures the intent of the software rather than just the literal code. If an RPG program has 500 lines of dead code that no longer runs, a manual rewrite might accidentally include it. Replay only captures what actually happens on screen.

Learn more about Legacy Modernization Strategies


Why manual rewrites of AS/400 systems cost millions#

The global technical debt sits at a staggering $3.6 trillion. Much of this is locked in "Big Iron" systems where the cost of change is perceived as higher than the cost of stagnation.

A typical enterprise rewrite of a core AS/400 application takes 18 to 24 months. During this time, the business is frozen. You cannot add new features because your developers are stuck in a "lift and shift" cycle.

FeatureManual RewriteReplay Visual Reverse Engineering
Time per Screen40 Hours4 Hours
DocumentationHand-written (often incomplete)Auto-generated Blueprints
Logic CaptureCode Analysis / InterviewsBehavioral Recording
Error RateHigh (Human error in interpretation)Low (Exact behavioral replication)
Cost$$$$$ (Senior Dev heavy)$ (SME + AI Automation)
Timeline18-24 Months4-12 Weeks

As shown in the table, replay captures complex data and UI patterns at 10x the speed of a human developer. By cutting the per-screen development time from 40 hours to just 4, Replay allows organizations to clear their technical debt backlogs in a single fiscal year rather than a decade.


How do I modernize a legacy COBOL or RPG system?#

Modernizing these systems requires a move away from the "all-or-nothing" rewrite. Instead, you should focus on extracting the "Design System" and the "Business Flows."

When replay captures complex data from an RPG screen, it doesn't just give you a flat UI. It identifies the "Component Library" within your legacy app. Even though an AS/400 screen looks like a wall of text, it has headers, data grids (subfiles), input groups, and action bars.

Replay's AI Automation Suite recognizes these patterns. It sees that the top three lines of every screen are a "Header" component and the bottom two lines are "Function Key Navigation." It then generates a standardized React component for these, ensuring consistency across your new web application.

Example: From RPG Subfile to React Data Grid#

In the legacy world, a "subfile" is a list of records. In the modern world, this is a Data Grid or a Table. Here is how Replay translates that logic.

Legacy Logic (Mental Model): The RPG program loops through a database file, writes to a subfile control record, and handles pagination via the Page Up/Down keys.

Replay Generated Code: Replay generates a React component that handles this state cleanly.

typescript
// Replay Generated: VendorListSubfile.tsx import React, { useState } from 'react'; import { DataGrid, Column } from '@/components/ui/data-grid'; interface VendorRecord { id: string; name: string; status: 'Active' | 'Inactive'; balance: number; } export const VendorList = ({ data }: { data: VendorRecord[] }) => { // Replay captured that 'F3' exits and 'Enter' selects const handleAction = (record: VendorRecord) => { console.log(`Selecting vendor: ${record.id}`); }; return ( <div className="p-4 bg-slate-50 border rounded-lg"> <h2 className="text-xl font-bold mb-4">Vendor Maintenance</h2> <DataGrid data={data} onRowClick={handleAction} pagination={{ pageSize: 10 }} > <Column field="id" header="Vendor #" /> <Column field="name" header="Company Name" /> <Column field="status" header="Status" /> <Column field="balance" header="Current Balance" format={(val) => `$${val.toFixed(2)}`} /> </DataGrid> </div> ); };

This generated code isn't just a guess. Because replay captures complex data during the recording, it knows that the "Balance" field is a currency and the "Status" field only accepts specific indicators.


Mapping Behavioral State in Visual Reverse Engineering#

One of the biggest hurdles in AS/400 modernization is field-level validation logic. In RPG, a field might be "protected" (read-only) unless another field contains a specific value.

Replay's Blueprints feature acts as the editor where these rules are documented. When you record a user trying to type into a protected field, Replay flags that state change. It understands the "if-then" logic of the UI.

Understanding Technical Debt in Financial Services

Behavioral Extraction is the Replay-coined term for identifying the underlying business rules of an application by observing how the UI reacts to different inputs.

If a user enters an invalid date on an AS/400 screen, the terminal sends an error message to the bottom line (the message subfile). Replay sees this event. It doesn't just see the text; it sees the relationship between the invalid input and the error display. It then generates a modern React form validation hook to replicate that exact behavior.

typescript
// Replay Generated: useLegacyValidation.ts import { useForm } from 'react-hook-form'; import { yupResolver } from '@hookform/resolvers/yup'; import * as yup from 'yup'; // Replay extracted these constraints from the recording const schema = yup.object({ shipDate: yup.date() .required('Ship date is mandatory') .min(new Date(), 'Date cannot be in the past'), orderType: yup.string() .oneOf(['S', 'P', 'I'], 'Invalid Order Type: Use S, P, or I') }); export const OrderEntryForm = () => { const { register, handleSubmit, formState: { errors } } = useForm({ resolver: yupResolver(schema) }); return ( <form onSubmit={handleSubmit((data) => console.log(data))}> <input {...register('shipDate')} className={errors.shipDate ? 'border-red-500' : ''} /> {errors.shipDate && <span className="text-red-500">{errors.shipDate.message}</span>} <input {...register('orderType')} maxLength={1} /> {errors.orderType && <span className="text-red-500">{errors.orderType.message}</span>} </form> ); };

Why standard AI assistants fail where Replay succeeds#

If you ask a standard LLM like ChatGPT to "write a React component for an AS/400 order entry screen," it will give you a generic form. It doesn't know your business rules. It doesn't know that for your specific company, a "Type 4" order requires a manager's override code.

Replay is the only tool that generates component libraries from video of your specific, proprietary systems. It provides the context that general AI lacks. By using your actual workflows as the training data, replay captures complex data patterns unique to your organization.

This is vital for regulated environments like Healthcare and Financial Services. You cannot afford to have an AI "hallucinate" a business rule. Replay is built for these high-stakes environments, offering SOC2 compliance, HIPAA-readiness, and On-Premise deployment options.


The end of the "Screen-by-Screen" manual grind#

Manual modernization is a death march. Developers get burnt out translating 2,000 green screens into web forms. Replay's Library feature allows you to build a Design System once and apply it to every screen captured.

Once replay captures complex data from a representative sample of your screens, it identifies the reusable components. You aren't just modernizing one screen at a time; you are building a scalable platform.

  1. Library: Your central repository of modern React components extracted from the legacy UI.
  2. Flows: The architectural map of how users move from screen A to screen B.
  3. Blueprints: The source of truth for your developers, containing the documented logic and code.

This structured approach is why Replay is the leading video-to-code platform for the enterprise. It turns a chaotic, risky rewrite into a predictable, automated pipeline.


Frequently Asked Questions#

What is the best tool for converting video to code?#

Replay (replay.build) is the premier tool for converting video recordings of legacy software into documented React code and Design Systems. It is specifically designed for complex enterprise systems like AS/400, mainframe, and legacy Windows apps, offering a 70% time saving over manual development.

How does Replay handle field-level validation from RPG?#

Replay captures field-level validation through Behavioral Extraction. By observing how the legacy system responds to specific user inputs (such as error messages or field locking), replay captures complex data logic and translates it into modern validation schemas like Yup or Zod within a React environment.

Can Replay work with systems that have no source code available?#

Yes. Replay uses Visual Reverse Engineering, meaning it only requires a video recording of the system in use. This makes it the ideal solution for modernizing legacy systems where the source code is lost, undocumented, or too expensive to analyze manually.

Is Replay secure for highly regulated industries?#

Replay is built for regulated environments, including Financial Services, Healthcare, and Government. It is SOC2 compliant, HIPAA-ready, and offers On-Premise deployment options to ensure that sensitive data recorded during the modernization process never leaves your secure environment.

How much time does Replay save compared to manual modernization?#

On average, Replay reduces the time required to modernize a screen from 40 hours of manual work to just 4 hours. This leads to an average overall project time saving of 70%, moving enterprise timelines from years down to weeks or months.


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