Automated migration from IBM AS/400 ILE COBOL to modern Java with DB2/PostgreSQL connectivity. Zero manual rewriting. 100% functional compatibility.
IDENTIFICATION DIVISION.
PROGRAM-ID. RH00045C.
*********************************
WORKING-STORAGE SECTION.
01 WK-PRICE PIC S9(9)V99.
01 WK-QTY PIC S9(5).
LINKAGE SECTION.
01 LK-ORDER.
05 LK-ITEM PIC X(20).
05 LK-TOTAL PIC S9(11)V99.
PROCEDURE DIVISION.
EXEC SQL
SELECT PRICE INTO :WK-PRICE
FROM ITEMS
WHERE ITEM_CODE = :LK-ITEM
END-EXEC.
COMPUTE LK-TOTAL =
WK-PRICE * WK-QTY.
public class RH00045C extends CobolProgram {
protected BigDecimal wkPrice = BigDecimal.ZERO;
protected BigDecimal wkQty = BigDecimal.ZERO;
public class LkOrderType {
protected String lkItem = " ";
protected BigDecimal lkTotal = BigDecimal.ZERO;
}
@Override
public void callableStatement() {
sqlService.executeQuery(connection,
"SELECT PRICE FROM ITEMS WHERE ITEM_CODE = ?",
rs -> { wkPrice = rs.getBigDecimal(1); },
lkOrder.lkItem);
CobolMove.move(
wkPrice.multiply(wkQty), lkOrder, "lkTotal");
}
}
A complete DevOps pipeline to modernize your AS/400 estate — the live demo below is just the beginning
Export your COBOL source, copybooks, and DDS schemas from your AS/400 environment using our step-by-step guide.
Upload your files and our Migration12 engine transforms IBM ILE COBOL to clean, compilable Java with full SQL support.
Run side-by-side tests comparing original AS/400 output with Java output. Full functional compatibility verification.
Code conversion is just one piece. We deliver a full production-grade migration lifecycle with zero disruption to your running systems.
Both the original AS/400 program and the new Java run simultaneously on every request. We intercept calls transparently at the PCML layer — zero changes to legacy code, zero risk to production. Byte-level output comparison catches divergence before it ever reaches users.
Automated schema translation from DB2/400 physical and logical files to PostgreSQL — including DDS record formats, packed decimals, EBCDIC encoding, and AS/400-specific data types.
Automatic test case generation from production traffic. We capture real AS/400 request/response pairs and generate regression suites that validate every converted program against known-good outputs.
Microbenchmark suite that profiles every layer of the migrated stack — JDBC wrappers, runtime overhead, memory allocation — ensuring Java meets or exceeds AS/400 response times.
The Live Demo below lets you experience the conversion engine first-hand — just one step of the complete pipeline.
Try the ConverterExperience the conversion engine in real time — upload your own COBOL or try our demo program
Drop your .cbl file here
Drop .cpy/.cbl files here (optional)
Drop .json schema files (optional)
Follow these steps to extract the required files from your IBM AS/400 environment
What you need before starting
*ALLOBJ authority (or *USE on source files)STRSQL or IBM Access Client Solutions (ACS)# Test AS/400 port 449 (host server mapper)
nc -zv $AS400_HOST 449
# Test FTP
ftp $AS400_HOST
# Test PostgreSQL
psql -h $PG_HOST -p 5432 -U $PG_USER -d $PG_DB -c "SELECT 1"
Get your COBOL program source code from AS/400
-- Run via STRSQL or IBM ACS Run SQL Scripts
SELECT SYSTEM_TABLE_SCHEMA AS LIBRARY,
SYSTEM_TABLE_NAME AS SOURCE_FILE,
COUNT(*) AS MEMBER_COUNT
FROM QSYS2.SYSPARTITIONSTAT
WHERE SOURCE_TYPE IN ('CBLLE', 'CBL', 'SQLCBLLE')
GROUP BY SYSTEM_TABLE_SCHEMA, SYSTEM_TABLE_NAME
ORDER BY MEMBER_COUNT DESC;
#!/bin/bash
AS400_HOST="your.as400.host"
LIBRARY="YOUR_LIBRARY"
SRCFILE="QCBLSRC"
while IFS= read -r member; do
member=$(echo "$member" | tr -d '[:space:]')
[ -z "$member" ] && continue
ftp -n $AS400_HOST <<EOF
quote USER $AS400_USER
quote PASS $AS400_PASS
ascii
cd /QSYS.LIB/${LIBRARY}.LIB/${SRCFILE}.FILE
get ${member}.MBR extracted/cobol/${member}.cbl
quit
EOF
echo "Extracted: $member"
done < members.txt
COBOL include files referenced via COPY statements
-- List copybook members
SELECT SYSTEM_TABLE_MEMBER AS MEMBER,
SOURCE_TYPE AS TYPE,
NUMBER_ROWS AS LINES
FROM QSYS2.SYSPARTITIONSTAT
WHERE SYSTEM_TABLE_SCHEMA = 'YOUR_LIBRARY'
AND SOURCE_TYPE IN ('CBLLE', 'CBL', 'CPY', 'SQLCBLLE')
AND (SYSTEM_TABLE_NAME = 'QCPYSRC'
OR SYSTEM_TABLE_NAME = 'YOUR_COPYBOOK_FILE')
ORDER BY SYSTEM_TABLE_MEMBER;
grep "COPY " your_program.cbl
The IN MYLIB or OF MYLIB clause tells you which library contains each copybook.
Database file definitions needed for I/O and SQL translation
-- Generate CREATE TABLE DDL for a specific file
CALL QSYS2.GENERATE_SQL(
DATABASE_OBJECT_NAME => 'MYFILE',
DATABASE_OBJECT_LIBRARY_NAME => 'YOUR_LIBRARY',
DATABASE_OBJECT_TYPE => 'TABLE',
DATABASE_SOURCE_FILE_NAME => 'QSQLSRC',
DATABASE_SOURCE_FILE_LIBRARY_NAME => 'QTEMP',
DATABASE_SOURCE_MEMBER => 'TMP',
REPLACE_OPTION => '1'
);
Use our ExtractDDS tool to generate JSON schema files:
java -cp ".:jt400-21.0.3.jar" ExtractDDS FILE1 FILE2 FILE3
# Produces JSON like:
{
"RECORDFORMAT": {
"columns": [
{ "name": "FIELD1", "type": "CHAR", "length": 10 },
{ "name": "FIELD2", "type": "PACKED", "length": 7, "decimals": 2 }
]
}
}
Use the demo above to see instant results