COBOL to Maintainable Java & C#


COBOL to Java - Converting EBCDIC to ASCII

Overview

Mainframes use EBCDIC character-set to maintain data files. During the migration of a COBOL application to Java or C#, it is sometimes necessary to convert SEQUENTIAL files from EBCDIC to ASCII or vice-versa.
Also, sometimes it may be desirable for translated Java / C# applications to continue working with EBCDIC data files for a limited period.

This paper provides an overview of the issues and the solution to working with EBCDIC data.

The cause of complications: Packed-Decimal (PD) fields

Packed-Decimal (PD) fields are represented by same binary values (and hence same characters) in ASCII and EBCDIC. Therefore the character-set conversion process should be aware of their position and length, and exclude them from the conversion process.
This means the standard FTP utilities with Character-Set conversion facilities will generate incorrect results.

Solution-1: Using SoftwareMining EbcdicConvertor

SoftwareMining's EbcdicConvertor addresses the problem by taking note of the position of PACKED-DECIMAL fields. The utility can use two separate modes of operation:

Solution-2: Working Directly with EBCDIC files

By default the translated applications uses the same character-set (UTF) for everything from reading/writing (sequential) data files to displaying data on screen, database access and writing to Log-Files.
However the runtime system can be configured to use different character-sets for each of the above operations.
This would allow the system to continue updating database and screens in UTF but use EBCDIC for accessing sequential data files.



Share this page







  © 2019, SoftwareMining Technologies. All Rights Reserved. "SoftwareMining Technologies" is a trademark of Software Modernization Technologies Ltd (UK). Software Modernization Technologies Ltd. Registered in England company no: 7300248. Reg Offices: 8b Accommodation Road, London NW11 8ED, United Kingdom.