如何为Cobol副本生成java~jrecord代码 [英] How do you generate java~jrecord code for a Cobol copybook

查看:234
本文介绍了如何为Cobol副本生成java~jrecord代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用



首次生成屏幕



在此屏幕上输入Cobol Copybook和Sample文件(如果有的话)。
RecordEditor 会尝试为您填写字段。





您可能需要修复控制字段。一切正确时





当一切正确时 生成Java~JRecord 按钮



第二代屏幕



在此屏幕上,您可以




  • 选择模板模型

  • 如何格式化Java名称

  • 包ID等。





生成的代码



那里是可以使用的几个模板模型,包括




  • 标准 - 生成基本的JRecord代码。它将生成具有Cobol字段名称作为常量的Java类。这允许您使用IDE代码完成而不是键入Cobol-Field-Names。

  • lineWrapper - 围绕Cobol数据创建Java Wrapper。

  • Pojo - 创建读者/作者以将Cobol数据转换为Java Pojo的数据



生成代码按钮生成java代码。



LineWrapper:





Pojo:


How do you use the RecordEditor to Generate Java~JRecord code from a Cobol Copybook to read/write a Binary EBCDIC Mainframe File.

This a Question and answer to try an prevent some poor/misleading questions being asked or the answer can be pointed to.

解决方案

File Transfer

To transfer a Binary file from the Mainframe to Windows / *nix box you must do a Binary Transfer for a very simple reason: the Ebcdic --> Ascii program can not distinguish between binary fields and Text fields.

Comp-3 value   hex     hex after Ascii conversion

 400          x'400c'       x'200c'       x'40' is the ebcdic space character
                                          it gets converted to the ascii
                                          space character x'20'

You need to do a Binary transfer from the Mainframe. This will keep the file as EBCDIC and any binary fields will be untouched. You then read the file using Ebcdic.

You will need to check the RECFM on the Mainframe. If the RECFM is

  • FB - no problems just transfer
  • VB - either convert to FB on the mainframe of include the RDW (Record Descriptor Word) option in the file transfer.
  • Other - Convert to FB/VB on the mainframe

RecordEditor CodeGen

The RecordEditor will use details from a Cobol Copybook and a Sample file to generate Java~JRecord Code.

Installing the Recordeditor

Install version 0.98.4 or later. Consider the USB version, you just unzip to a normal directory and run from there. No install is needed

If you install either HSQL version, restart the computer before use

Starting the Code Generator

To start the Code-Generator, select Generate >>> Java~JRecord code for Cobol

First Generate Screen

On this screen enter the Cobol Copybook and Sample file (if you have one). The RecordEditor will try and fill in the fields for you.

You may need to fix up the control fields though. When everything is correct

When everything is correct press the Generate Java~JRecord button

Second Generate Screen

On this screen you can

  • Select the Template or Model
  • How the Java names are formated
  • package id etc.

Generated code

There are several Templates or Models that can be used, including

  • Standard - generates basic JRecord code. It will generate Java classes with Cobol field names as constants. This allows you to use IDE code completion instead of typing in the "Cobol-Field-Names".
  • lineWrapper - Create a Java Wrapper around the Cobol Data.
  • Pojo - Creates Readers / Writers to convert Cobol Data to/from Java Pojo's

press the Generate Code button to generate java code.

LineWrapper:

Pojo:

这篇关于如何为Cobol副本生成java~jrecord代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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