Menu

Generate Code for Binary Cobol file

Bruce Martin
Attachments
Gen01-fs8.png (4306 bytes)
Gen02-fs8.png (15897 bytes)
Gen02a-fs8.png (4734 bytes)
Gen05-or8.png (19889 bytes)
Gen06a-or8.png (20068 bytes)
Gen06b-or8.png (25254 bytes)

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 and read the file using Ebcdic.
You will need to check the RECFM on the Mainframe. If the RECFM is

  • FB - 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.

Starting the Code Generator

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

foobar

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.

foobar

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

foobar

Second Generate Screen

On this screen you can

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

gen2

Generated code

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

  • Standard - generates basic JRecord code
  • lineWrapper - Create a Java Wrapper around the Cobol Data.
  • Pojo - Creates Readers / Writers to convert Cobol Data to/from Java Pojo's

Standard:

standard

Pojo:

pojo