Which Cobol Dialect ????. The format of Numeric data is different for different Cobol compilers. There are also related question or another question
Anyway have a look at these java projects:
- JRecord it based on the code for RecordEditor. This project can read and write files using a Cobol Copybook. It can also handle multiple record formats in the same file. If it is just a single record format, there is also Csv2Cobol utility. JRecord is well suited for Generic utilities based on Cobol Copybooks
- Cobol2J - might have problems if there are multiple record formats in the file.
- Cb2xml - This package will read a Cobol copybook and convert it to Xml. The Xml holds all the Cobol fields with there Starting position, length Picture definition. The latest version has JaXB example code for processing the Xml. Cb2xml is used by JRecord, Cobol2J plus some Commercial packages e.g. Stirling Map editor, CA DevTest Solutions
- legstar
- There are other Open Source projects out there but most need more work than the above.
- There are several commercial packages available that can convert to/from Mainframe Cobol files. e.g. IBM has packages that can generate Java classes for Cobol files. Most are expensive though.
Of the above, all will handle IBM Mainframe Cobol; JRecord offers limited support for other Cobol compilers.
Bill will no doubt mention that if you choose any of the above, you will need to satisfy the auditors of there use. That said, JRecord, Cb2Xml and Legstar are used in either Commercial packages or Large Open Source Transformation projects.
Also Legstar looks to be becoming semi commercial, so check the license.
Disclosure: I wrote JRecord, RecordEditor and helped in the writing of Cb2Xml with Peter and Jean-Francois