The Process

From legacy source code
to production Java

A structured five-step engagement — from your first codebase submission to validated, production-ready Java 21 output. Works for RPG and COBOL.

01
Intake
Submit your codebase
You share your source files — RPG (RPGLE, SQLRPGLE, CL, DDS) or COBOL (CBL, COB, CPY, JCL). There is no agent to install and no change to your AS/400 or mainframe environment. A secure transfer over SFTP or a private object store is all we need.
📁
Supported formats
.rpgle, .sqlrpgle, .rpginc, .clle, .clp, .dds, .pf, .lf
🔒
Secure transfer
SFTP, presigned S3/GCS, or encrypted ZIP. Your code never touches a public endpoint.
📊
Any scale
From a handful of programs to thousands of files across multiple libraries.
02
Analysis
Corpus analysis & scoping report
Language Foundry catalogs every source file and identifies the constructs present — SQL embeds, indicator usage, cycle logic, GOTO/TAG patterns, subroutines, and file I/O. You receive a detailed scoping report before any transpilation begins, so there are no surprises about scope or timeline.
Example scoping report extract catalog/report.md
| Metric                        | Count  |
|-------------------------------|--------|
| Total source files            | 20,682 |
| RPG / RPGLE files             |  3,562 |
| COBOL / CBL files             | 17,104 |
| CL / CLLE files               |      1 |
| Files with SQL embeds         |    203 |
| Files with GOTO / TAG         |    222 |

// COBOL benchmark across 168 repos:
| Programs benchmarked          |  6,960 |
| Total statements              |568,095 |
| Handled                       |568,095 |
| Quarantined                   |      0 |

// Opcode frequency (top 3)
MOVE    1,008   READ     613   PERFORM  585
Deliverable at this stage
Full file catalog (extension, line count, pattern flags) in JSON
Opcode frequency analysis
Estimated handle rate and quarantine breakdown
Recommended migration sequencing (easiest → hardest programs)
03
Transpilation
Automated conversion to Java 21
Each RPG program passes through the four-gate pipeline. The engine handles free-form and fixed-form syntax, packed-decimal arithmetic, data structures, built-in functions, subroutines, and conditional logic. Unrecognised constructs are logged in the quarantine ledger — never silently skipped.
🔭
Gate 1 — Scout
Preprocesses source: strips continuation markers, normalises columns, expands /COPY directives.
🔬
Gate 2 — Analyst
ANTLR 4 grammar parses RPG IV into a fully typed abstract syntax tree.
🏗️
Gate 3 — Builder
AST walker emits idiomatic Java 21 using the foundry-rt runtime library.
📋
Quarantine ledger
Every unresolved construct is recorded with file, line number, construct type, and source text.
Transpiler output trace handled: 158 / quarantined: 0
// Input RPG
IF qty > 100;
  discount = 0.15;
  total = total - (total * discount);
ENDIF;
DSPLY %CHAR(total);

// Generated Java 21
if (qty > 100L) {
  discount = RpgDec.of("0.15", 5, 4);
  total = RpgDec.of(total.big().subtract(
    total.big().multiply(discount.big())), 11, 2);
}
RT.dsply(RT.charOf(total));
04
Validation
Equivalence testing — proof, not hope
For every converted program, the Validator executes both the original RPG and the generated Java against identical test inputs. Output streams are captured and diffed character-by-character. A match is a proof of semantic equivalence — not just "it compiled".
🧪
Side-by-side execution
RPG runs on the AS/400 simulator; Java runs on the JVM. Same inputs, outputs compared.
🔢
Exact decimal arithmetic
The RpgDec runtime type replicates packed-decimal precision and rounding to the digit.
📄
Equivalence certificate
Each passing program receives a signed equivalence certificate with the diff hash.
Deliverable at this stage
Pass / fail report per program
Equivalence certificates for all passing programs
Annotated quarantine ledger for any programs requiring manual review
05
Delivery
Production-ready Java package
You receive the converted Java source files, the foundry-rt runtime JAR, a Maven/Gradle build descriptor, the full equivalence report, and the quarantine ledger — everything needed to integrate into your existing CI/CD pipeline and deploy on any standard JVM infrastructure.
☁️
Any JVM target
Java 21 LTS — runs on AWS, Azure, GCP, on-premise, or containerised with Docker.
🔧
Build-system ready
Maven and Gradle descriptors included. foundry-rt ships as a standard JAR dependency.
📦
Ongoing support
We handle re-runs for updated source files and can expand quarantine coverage in follow-on engagements.
Final deliverables
Java 21 source files, one class per RPG or COBOL program
foundry-rt runtime JAR (RpgDec, RpgChar, RT, harness)
Maven / Gradle build files
Full equivalence report with per-program pass/fail status
Quarantine ledger with remediation guidance for any unresolved constructs

Common questions

Do we need to modify our AS/400 environment?
No. Language Foundry works entirely from source files. You export your RPG programs as text and transfer them securely. Nothing is installed on the AS/400 and your production system is never touched.
What happens to programs the transpiler can't fully convert?
Every unhandled construct is logged in the quarantine ledger with the exact file, line number, construct type, and source text. You get a full report so your team can see exactly what needs manual attention — there are no silent failures or blank output files.
How accurate is the arithmetic conversion?
The foundry-rt RpgDec type wraps Java's BigDecimal and enforces RPG packed-decimal precision, scale, and half-even rounding. Equivalence tests confirm that numeric results match the original RPG output to the last digit — not approximately, exactly.
Can the converted Java call existing RPG programs we haven't migrated yet?
Yes. The generated Java can be wired to JCA connectors or IBM Toolbox for Java (JTOpen) to call remaining RPG programs on the AS/400, enabling an incremental migration where both old and new code run side-by-side during transition.
How long does the process take?
The automated transpilation itself is fast — hundreds of programs process in minutes. The overall engagement timeline depends on the size of the codebase and how much manual remediation is needed for quarantined constructs. A scoping report (Step 2) gives a precise estimate before work begins.
Is the generated Java idiomatic or literal?
Structurally idiomatic: one Java class per RPG program, subroutines become private static methods, data structure fields become class fields, and built-in functions map to RT static methods. The output is readable by any Java developer and integrates cleanly with standard Java tooling.

Ready to start your migration?

Get in touch to discuss your codebase and receive a no-obligation scoping report.

Contact Us WhatsApp Read the Whitepaper