从Java读取cobol数据结构 [英] Reading cobol datastructures from Java

查看:643
本文介绍了从Java读取cobol数据结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在Java程序中阅读cobol数据?更具体地说,我遇到了以下情况:



我有一个具有固定长度数据记录的文件。数据定义完成为Cobol副本。我想到的是,考虑到这些副本的图书馆将能够阅读这些记录。



理想情况下,应该可以根据副本信息生成基本的java类和结构。在后面的步骤中,数据记录将被解析,数据填充到这些生成的类的对象中。



你知道一个提供这种功能的图书馆吗?或任何其他技巧来解决阅读cobol数据的问题?






有一些商业工具提供此功能。然而,它们非常昂贵。您是否知道任何开源的替代方法或不同工具的组合来提供整个功能?例如,cb2xml读取copybook结构并将其转换为xml。稍后的步骤将是基于cb2xml xml信息生成记录读取器。或使用可配置的记录读取器。你知道一个cobol记录阅读器(解码器)吗?

解决方案

你可以看看JRecord - http://sourceforge.net/projects/jrecord/
或cb2java http://sourceforge.net/projects/cb2java/ 都允许您访问cobol文件
,但都不会生成完整的类。 / p>




自原始答案:




  • 继续开发JRecord。现在有一个 JRecord代码生成器作为
    可以是独立程序,也可以在 Recordeditor
    这个代码生成器将从Cobol Copybook构建 JRecord JRecord 代码。
    请参阅RecordEditor Jrecord CodeGen

  • 开发 cb2java 已停止

  • cobol2j 已经写完了。一年没有更新

  • 另外还有一些 Legstar 没有发表年


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. What I think of is a library which taking into account the copybooks 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.

Do you know a library providing this kind of functionality? Or any other techniques to cope with the problem of reading cobol data?


There are some commercial tools which provide this functionality. They are, however, very expensive. Do you know any open-source alternative or a combination of different tools to provide the entire functionality? For example the cb2xml reads copybook structures and transforms them into xml. A later step would be to generate a record reader based on the cb2xml xml information. Or to use a record reader which is configurable. Do you know a cobol record reader (decoder)?

解决方案

You could look at JRecord - http://sourceforge.net/projects/jrecord/ or cb2java http://sourceforge.net/projects/cb2java/ both allow you to access cobol files but neither will generate the full classes.


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

这篇关于从Java读取cobol数据结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆