Mainframe COBOL to Java, C# & Cloud

CICS COBOL (Mainframe) to Java/ C# Conversion

CICS is IBM's Transaction Processing libraries which have been used in numerous large scale applications. The libraries cater for multi-user access to functions such as reading and writing of records, screens handling, queue management, error-handling and etc. I.e all the features required by large multi-user applications.

However, these days very few new developers are being trained in COBOL, and even fewer new developers have knowledge of CICS, BMS, MQ, RACF, JCL and all those other secondary technologies needed for maintenance of such applications. This all affects the long term maintenance aspects of such COBOL applications.

SoftwareMining's translation of such applications to Java/C# focuses on improving the long term maintainability, and use following approaches to meet this goal: SoftwareMining's approach enables new Java/C# developers (with no prior knowledge of CICS) to take on the long term maintenance of the new Java/C# application.

Click here for a list of the most widely used and supported CICS API.

The Essential Components

Conversion of Pseudo-conversational to Session-Based Application Server design

On-line CICS applications are suitable candidates for conversion to an event-driven architecture; where screens are "sent" to and "received" from terminals. This makes CICS on-line Applications are prime candidates for conversion to Application-Server architecture JAVA or C#. CICS On-line applications which have many concurrent users are usually designed in a pseudo-conversational architecture. This design reduces the processor and storage requirements. Such applications are ideal for migration to a Session based Java/C# code which implement similar technologies, and allow implementation of new application within a cloud based architecture.

Migration of BMS Screens to HTML

BMS is used for Screen Definitions in IBM CICS applications.
SoftwareMining's Conversion tool translates the BMS Screens to variety of options in including JSP, ASP and XML. These are used at runtime to generate HTML. The main objective of the conversion process is to:
  • Provide identical functionality, look and feel. This reduces the amount of testing which need to be performed

  • Reduce maintenance overheads by make translated code understandable to new developers. This is achieved by translation of cryptic CICS statements to descriptive and meaningful statements. For more information please see From cryptic COBOL+CICS/BMS to maintainable Java/C#.

  • Provide an upgrade path. SoftwareMining provides Screen Enhancement utilities for retro-fitting new look and feel (menus, drop-downs, ...). The translated code also supports a plug-and-play type architecture where new JSP / ASP screens can simply replace the character-based HTML screens without any alterations to the java code.

Reading/Writing Indexed Files (EXEC CICS READ WRITE REWRITE)

CICS READ / WRITE statements use a very generic & high level approach to accessing data files. For example in a WRITE statement, same as in VSAM file access, the Structures field information is used to format the record, and used to write a series of characters to the file. Unlike database tables the file does not contain any column information, and can be read into any other compatible structure.
In contrast - the translation will convert record definitions from CICS /VSAM Files to a Data-Access Objects (DAO) with Object-Relational design. The DAO's will have the following characteristics:
  • A database tables will be created for each DAO. The table will contain a COLUMN for each of the original COBOL fields
  • DAO's will also have all the fields from the original FD (e.g. class EMPLOYEE contains many field: Age, Role, Salary, ...).
  • Operations are performed on objects - e.g.
  • The DAO will automatically generate the required SQL at runtime. The SQL is not hard coded into DAOs.

The generated Data-Access-Objects can be easily re-generated to access existing VSAM data-files instead of SQL tables. There are also mechanisms for communication between java and COBOL. This allows an gradual and incremental migration path. Ie the code base is gradually moved from COBOL to Java in first step, and in 2nd step the data-files are gradually moved from VSAM to SQL.
Hence a big bang migration approach can be avoided.

Security and RACF

CICS security system provides mechanism to route authorization requests to an external security manager such as RACF,

SoftwareMining framework uses a similar approach where you can either use SoftwareMining's default security manager (replacement for RACF), or route the security verifications to an external module (e.g. LDAP).
Once a security module has been enabled, the translated Java/C# system will check users privileges for access to:
  • Transaction Invocation e.g. does User-1 have access permission to Delete-Inventory-Item screen: ?
  • Data-Access e.g. does User-1 have access permission to delete records from table: Inventory-Items ?

Communicating with MQSeries

Whist MQ-Series is not part of the IBM CICS libraries, the MQ messaging system is used in many larger CICS applications.

SoftwareMining tackles Message Queuing by Translation of MQ API to a vendor-neutral set of API.
This is done by correctly identifying MQ calls and translating them to a Vendor neutral API. For example translating:
 MQManager.Get(... );
Where MQManager can be configured to use different messaging implementations. This design, in the short term will allow the application to use link and communicate with IBM-MQ messaging service, and in medium term to move another messaging system (e.g. Java JMS).

SoftwareMining provides a simple implementation which uses Open-Source ActiveMQ libraries. But the above design makes it easy to use any other Message-Queuing tools.

Other CICS Libraries

CICS framework supports many other functionality - from queue management (READQ / WRITEQ) to routeing output to printers.
Where possible SoftwareMining translates COBOL CICS programs to native Java or C# patterns. For example, reading/writing QUEUES (READQ and WRITEQ) is implemented to a standard libraries (slightly augmented HasMaps, Dictionaries or persistent DB records) in the target language. This approach simplifies the architecture of the generated Java code and eases the future maintenance of the system.

Supported CICS API

The following is a summary of the most widely used CICS API which are supported by SoftwareMining's Translation tools.
    Error handling
  • EXEC CICS HANDLE CONDITION Handle conditions.
  • EXEC CICS ABEND Terminate a task abnormally.

  • Starting a Task at a later time
  • EXEC CICS START start a task at a specified time.
  • EXEC CICS RETRIEVE The RETRIEVE command retrieves data stored by expired START commands.

  • Flow logic Control
  • EXEC CICS LINK LINK passes control from an application program at one logical level to an application program at the next lower logical level.
  • EXEC CICS XCTL XCTL transfers control from one application program to another at the same logical level.
  • EXEC CICS RETURN RETURN returns control from an application program either to an application program at the next higher logical level, or to SoftwareMining framework

  • Online / Screen handling
  • EXEC CICS SEND TEXT Send data to screen (web-browser) without mapping.
  • EXEC CICS SEND MAP Sends A BMS map to screen (web-browser)
  • EXEC CICS SEND Send mapped output data to a screen (web-browser).
  • EXEC CICS RECEIVE MAP maps input data from a screen (web-browser)into a data area in an application program.
  • EXEC CICS RECEIVE Receive data from a screen (web-browser)

  • VSAM Access (ported to SQL Tables and accessed through Object-Relational Data-Access Objects)
  • EXEC CICS READ Read a record from a data-source.
  • EXEC CICS READNEXT Read next record during a browse of a data-source.
  • EXEC CICS READPREV Read previous record during a data-source browse; VSAM and data tables only.
  • EXEC CICS WRITE Write a record.
  • EXEC CICS STARTBR specifies the record in a data-source where the browse is to start.
  • EXEC CICS ENDBR End the browse of a data-source.

  • Temporary Storage Queues
  • EXEC CICS READQ TS / TD read from temporary storage / transient data queue.
  • EXEC CICS WRITEQ TS / TD Write data to a temporary storage / transient data queue
  • EXEC CICS DELETEQ TS / TD Delete a temporary storage / transient data queue.

  • Date/Time
  • EXEC CICS FORMATTIME Transform absolute date and time into a specified format.

  • Miscellaneous
  • EXEC CICS ASSIGN Request values from outside the local environment of the application program. SoftwareMining supports a multitude of ASSIGN parameters.
  • EXEC CICS ROUTE Currently only ROUTE NLEOM (routing to printers) is supported.
  • EXEC CICS GET COUNTER / DCOUNTER Get the next number from the named counter in the specified pool.
  • EXEC CICS DEFINE COUNTER / DCOUNTER create a named counter in a named counter pool in the coupling facility.
  • EXEC CICS PUT/GET CONTAINER Place or retrieve data in a named channel container.

Related Papers

IBM CICS COBOL to Java/C# Migration Project Phases

The Migration of COBOL applications to Java or C# involves:
  • Asset Management: Identify all the artefacts required for translation .
  • Translate to target language
  • Database and Data Migration
  • Migrate JCL
  • Create and Populate of Test Database
  • System acceptance testing
  • User Acceptance Testing
  • (Optional): Other Improvements: Screen Redesign, SOA Integration, Cloud Deployments, Coding Improvements and clean up

Comparing COBOL to translated code

Comparison of Converted code: COBOL to Java
Comparison of Converted code: COBOL to C#
COBOL to Java / C# Conversion Tool - Download Trial (Release 2023-01-09)

Related White Papers

References: IBM CICS COBOL

Pseudo Conversational Transactions (Wiki)
Pseudo Conversational Transactions (IBM)

  © 2023 SoftwareMining is a trademark of Software Modernization Technologies Ltd (UK). Registered in England company no: 07300248. Reg Offices: 79 Stevens House, Jerome Place, Kingston Upon Thames, KT1 1HX, United Kingdom.