Skip to Content
ConnectorsCOBOL Migration

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

StrategyDescriptionBest for
COBOL → TypeScriptTranspile business logic to TypeScript with modern patternsWeb services, APIs, microservices
COBOL → JavaGenerate Java classes preserving COBOL program structureEnterprise backends, Spring Boot apps
DB2 → PostgreSQLConvert DB2 DDL and embedded SQL to PostgreSQLCloud-native data layer migration
JCL → CI/CD PipelineTransform JCL job streams to GitHub Actions or Temporal workflowsBatch processing modernization

Migration wizard

Access via Settings → Integrations → Connectors → IBM Mainframe → COBOL Migration.

Inventory tab

View all discovered COBOL programs with metadata:

ColumnDescription
ProgramCOBOL program ID
LOCLines of code
CopybooksNumber of COPY dependencies
SQL stmtsEmbedded SQL statement count
CICS cmdsCICS command count
ComplexityLow / 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

  1. Select programs — choose individual programs or use Select All.
  2. Choose target language — TypeScript, Java, or both.
  3. Configure options:
    • Include DB2 migration (DB2 → PostgreSQL)
    • Include JCL migration (JCL → CI/CD)
    • Enable HITL approval gates
  4. Start migration — launches a migration run.

History tab

Track all migration runs with status, timestamps, and results:

StatusDescription
RunningMigration agents are actively processing
Waiting for approvalHITL gate reached — review required
CompletedAll programs successfully migrated
FailedMigration 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:

AgentInputOutput
COBOL Parser AgentCOBOL sourceAST + business rule extraction
Code Generator AgentAST + rulesTypeScript or Java classes
Test Generator AgentCOBOL paragraphsUnit tests matching original behavior
DB Migration AgentDB2 DDL + SQLPostgreSQL schema + queries
JCL-to-Pipeline AgentJCL proceduresGitHub 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 constructModern equivalent
WORKING-STORAGE SECTIONClass fields / module state
PERFORM ... THRUFunction calls
EXEC SQL ... END-EXECORM queries / parameterized SQL
EXEC CICS ... END-EXECREST endpoints / message handlers
COMP-3 (packed decimal)BigDecimal / decimal libraries
COPY statementModule imports
CALL programFunction/service calls
Batch JCL (SORT, MERGE)ETL pipelines / streaming

API

MethodEndpointDescription
GET/connectors/mainframe/:id/programsList COBOL program inventory
POST/connectors/mainframe/:id/migrateStart a migration run
GET/connectors/mainframe/:id/migrationsList migration run history
GET/connectors/mainframe/:id/migrations/:runIdMigration 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

Last updated on