Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
556 views
in Technique[技术] by (71.8m points)

data structures - Reading COBOL datastructures from Java

Is there a way to read COBOL data in a Java program? More concretely I'm confronted with the following case:

I have a file with fixed length records of data. The data definition is done as COBOL copybooks. I think of a library which is taking into account the copybooks and would be able to read those records.

Ideally, it should be possible to generate basic Java classes and structures based on the copybook information. In a later step the datarecords would be parsed and the data filled into objects of those generated classes.

Are there any other techniques to cope with the problem of reading COBOL data?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You could look at JRecord or cb2java. Both allow you to access COBOL files, but neither will generate the full classes.


Update Jan 2011

Since the original answer:

  • JRecord continues be developed. There is now a JRecord Code generator available as either a standalone program or in the Recordeditor. This Code Generator will build JRecord JRecord code from a COBOL Copybook. See RecordEditor Jrecord CodeGen)
  • Development on cb2java has stopped
  • cobol2j has been written. There have been no updates for a year.
  • There is also Legstar again nothing published for a few years

Update Aug 2017

The RecordEditor has a Generate option for generating Java / JRecord code from a COBOL Copybook. See RecordEditor Code Generation notes for details.

Update Jan 2018

There is some information on generating Java~JRecord code in this question / answer:

How do you generate java~jrecord code for a Cobol copybook


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...