COBOL Migration
Migrate legacy COBOL applications to modern languages using Cendriix’s AI-powered migration pipeline. Requires an active IBM Mainframe connection.
Overview
The COBOL migration pipeline combines Cortex knowledge extraction, agent-driven code generation, and human-in-the-loop approval gates to modernize mainframe applications safely and incrementally.
End-to-end migration architecture
Agent squad orchestration
Each agent runs in an isolated Devbox sandbox with its own filesystem and toolset. The Cendra orchestrator coordinates execution, passes artifacts between agents, and enforces HITL gates before any code reaches production.
Migration strategies
| Strategy | Description | Best for |
|---|---|---|
| COBOL → TypeScript | Transpile business logic to TypeScript with modern patterns | Web services, APIs, microservices |
| COBOL → Java | Generate Java classes preserving COBOL program structure | Enterprise backends, Spring Boot apps |
| DB2 → PostgreSQL | Convert DB2 DDL and embedded SQL to PostgreSQL | Cloud-native data layer migration |
| JCL → CI/CD Pipeline | Transform JCL job streams to GitHub Actions or Temporal workflows | Batch processing modernization |
Migration wizard
Access via Settings → Integrations → Connectors → IBM Mainframe → COBOL Migration.
Inventory tab
View all discovered COBOL programs with metadata:
| Column | Description |
|---|---|
| Program | COBOL program ID |
| LOC | Lines of code |
| Copybooks | Number of COPY dependencies |
| SQL stmts | Embedded SQL statement count |
| CICS cmds | CICS command count |
| Complexity | Low / Medium / High scoring |
Use the complexity filter to focus on programs matching your migration strategy (e.g., start with Low complexity programs for quick wins).
Migration tab
- Select programs — choose individual programs or use Select All.
- Choose target language — TypeScript, Java, or both.
- Configure options:
- Include DB2 migration (DB2 → PostgreSQL)
- Include JCL migration (JCL → CI/CD)
- Enable HITL approval gates
- Start migration — launches a migration run.
History tab
Track all migration runs with status, timestamps, and results:
| Status | Description |
|---|---|
| Running | Migration agents are actively processing |
| Waiting for approval | HITL gate reached — review required |
| Completed | All programs successfully migrated |
| Failed | Migration encountered errors (click to view details) |
Migration pipeline
Each migration run executes a 7-stage DAG:
Stage 1 — Parse
The COBOL parser extracts program structure:
- Identification, Environment, Data, and Procedure divisions
- Paragraph boundaries and PERFORM targets
- COPY statement resolution (copybook expansion)
- CALL targets (inter-program dependencies)
- Embedded SQL extraction (
EXEC SQL ... END-EXEC) - CICS command extraction (
EXEC CICS ... END-EXEC)
Stage 2 — Atomize
Parsed output is stored in Cortex as knowledge atoms with full provenance. This enables Cendra to answer questions about your COBOL estate and supports dependency analysis.
Stage 3 — Analyze dependencies
Build a program dependency graph:
- CALL chains (A calls B calls C)
- Copybook sharing (programs that include the same copybook)
- DB2 table access patterns
- JCL step sequences
Stage 4 — Generate code
Agent squad produces target code:
| Agent | Input | Output |
|---|---|---|
| COBOL Parser Agent | COBOL source | AST + business rule extraction |
| Code Generator Agent | AST + rules | TypeScript or Java classes |
| Test Generator Agent | COBOL paragraphs | Unit tests matching original behavior |
| DB Migration Agent | DB2 DDL + SQL | PostgreSQL schema + queries |
| JCL-to-Pipeline Agent | JCL procedures | GitHub Actions or Temporal workflows |
Stage 5 — HITL review
If HITL gates are enabled, the generated code is presented for human review before proceeding. Reviewers can approve, reject, or request changes.
Stage 6 — Validate
Side-by-side comparison of original COBOL behavior vs. generated code:
- Same inputs → same outputs verification
- Boundary condition testing
- Performance benchmarks
Stage 7 — Deploy
Generate pull request with:
- Migrated source code
- Unit tests
- Database migration scripts
- CI/CD pipeline definitions
- Migration report
COBOL patterns → Modern equivalents
| COBOL construct | Modern equivalent |
|---|---|
WORKING-STORAGE SECTION | Class fields / module state |
PERFORM ... THRU | Function calls |
EXEC SQL ... END-EXEC | ORM queries / parameterized SQL |
EXEC CICS ... END-EXEC | REST endpoints / message handlers |
COMP-3 (packed decimal) | BigDecimal / decimal libraries |
COPY statement | Module imports |
CALL program | Function/service calls |
Batch JCL (SORT, MERGE) | ETL pipelines / streaming |
API
| Method | Endpoint | Description |
|---|---|---|
GET | /connectors/mainframe/:id/programs | List COBOL program inventory |
POST | /connectors/mainframe/:id/migrate | Start a migration run |
GET | /connectors/mainframe/:id/migrations | List migration run history |
GET | /connectors/mainframe/:id/migrations/:runId | Migration run details |
Known limitations
- COBOL parser uses regex-based extraction (not a full compiler). Traditional sequence-numbered COBOL (columns 1–6) may not parse correctly in all cases.
- Nested COPY REPLACING is not yet supported.
- CICS BMS map generation is not included in the current migration pipeline.
- Programs exceeding 50,000 LOC should be manually reviewed for decomposition before migration.
See also: IBM Mainframe Connector, All Connectors, Cortex, Agents