SoftwareMining's automated, rule-based COBOL-to-Java Conversion Toolkit converts IBM mainframe applications using CICS and VSAM into maintainable Java applications. The toolkit translates COBOL business logic and supported CICS file-access operations, and generates the Java data-access classes and SQL structures required to replace VSAM KSDS files with relational database tables. See how SoftwareMining translates other supported CICS commands and services .
The generated application uses Java classes and data-access components designed to reduce ongoing dependence on knowledge of the original COBOL, CICS and VSAM implementation. This page demonstrates how SoftwareMining converts a representative VSAM KSDS record and its CICS file operations, including the COBOL record structure, indexed access, generated Java class and corresponding SQL table.
During translation, SoftwareMining analyses the COBOL program and identifies
WORKING-STORAGE structures used by CICS file operations. For example, when
CLIENT-RECORD is used by a CICS READNEXT operation,
the toolkit generates a corresponding Java Data Access Object (DAO), such as
ClientRecord.
The COBOL record layout and VSAM key definition are also used to generate the
SQL table definition. The generated ClientRecord DAO reads and
writes the resulting database rows while preserving the record fields and
indexed-access behaviour required by the translated application.
The following example shows how SoftwareMining translates a
CLIENT-RECORD KSDS layout into Java and SQL. Although the record
begins at COBOL level 05 rather than level 01, the toolkit identifies the
structure from its use in the CICS file operation and generates it as a
separate Java class.
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();
...