Migrating IBM CICS and VSAM Data During COBOL to Java Refactoring

IBM mainframe apps often use CICS for transactions and VSAM for fast file access. This page explains how to move VSAM data and related APIs to Java. The goal is clear, maintainable Java that Java developers can own, even without COBOL or CICS background.

SoftwareMining parses COBOL, analyzes flow, and then generates Java. During generation, the tool restructures logic for long-term maintainability. It also identifies WORKING-STORAGE structures used by CICS I/O and turns them into Java classes. For example, if CLIENT-RECORD is used in a CICS READNEXT, it will be extracted from the WS-DATA group and generated as a CICS-aware Data Access Object (DAO) named ClientRecord.

The same COBOL record layout drives SQL DDL generation for the KSDS file. The generated ClientRecord class then reads and writes rows using SQL, preserving keys and record structure.

Example: VSAM to Java Conversion

Below, a KSDS layout CLIENT-RECORD is translated to Java. The fact that it starts at level 05 (not 01) does not reduce clarity in the generated code.

CICS COBOL
WORKING-STORAGE SECTION.
01 WS-DATA.
  05 WS-TMP.
     10 LEN              PIC 9(9) VALUE 0.
     10 KEY              PIC 99V99 VALUE 0.
  05 CLIENT-RECORD
     10 NAME             PIC X(20).
     10 ADDRESS          PIC X(20) OCCURS 3 TIMES.
     10 ID               PIC 9(4) COMP.
...
        
Generated Java
// Since 05 CLIENT-RECORD is used in a CICS READNEXT,
// it is extracted from WS-DATA and refactored as a
// CICS-aware Object-Relational DAO.
private ClientRecord clientRecord = new ClientRecord(this);

// WS-DATA is still generated, but without CLIENT-RECORD fields.
private WsData wsData = new WsData(this);

...
        
EXEC CICS
  READNEXT DATASET('CLIENT-FILE')
          INTO(CLIENT-RECORD)
          RIDFLD(KEY)
          LENGTH(LEN)
END-EXEC
...
        
// CICS-aware DAO uses the same data
// Key value comes from WS-DATA
clientRecord.assignKeyValue(wsData.getKey());

// File name is not used by SQL, but can be mapped to table name
clientRecord.assignFileName("CLIENT-FILE");

// SQL for key-based read is generated internally by the ORM
clientRecord.next();

...