-->

How do you edit a Binary Mainframe file in the Rec

2019-05-27 06:07发布

问题:

How do you edit a Single-Record-type Binary Mainframe file in the RecordEditor using Cobol Copybook on a Windows or Linux PC.

Note: This is an attempt to split a very broad question into a series of simpler Question and Answers.

回答1:

To Edit a File in the RecordEditor with a Cobol Copybook you must first load the copybook and then edit the file

Loading the Cobol Copybook into the RecordEditor

Select Record Layouts >>> Load Cobol Copybook menu options

On the Cobol Load Screen enter the Cobol Copybook and your Mainframe Data file. The RecordEditor will read the file and try and work out what the file attributes are.

The Important attributes

  • Split Copybook: use No Split for a Single record type file
  • Font (or Charset / encoding) You need to enter the appropriate encoding for the file. Cp037 (or IBM037) is US-EBCDIC, CP273 (or (IBM273) is German EBCDIC.
  • Cobol Dialect Mainframe for IBM Mainframe cobol
  • File Structure This corresponds RECFM attribute on the Mainframe.
    • use Fixed Length Binary for RECFM=FB
    • use Mainframe VB (rdw based) Binary for RECFM=VB

The RecordEditor will try display the file using the current attributes on the Righthand side of the screen. You can play around with attribute.

If you can not get the file display correctly, you could have the wrong Cobol Copybook. You must use a Cobol Copybook that matches the data exactly, near enough is never good enough.


Viewing (Editting your file)

Once you have loaded you copybook, go to the Open files screen.

....

  • Select you data file
  • select you copybook in the Record Layout field
  • Click on on Edit (The return key should also work).

Generating Java Code to Read the file.

To generate Java~JRecord Code to read the file select Generate >>> Generate Java~JRecord code for Cobol.

The first screen is basically the same as the Import Cobol Copybook screen. This answer has details on generating Java code