Record Editor

This is a Programmers Data-file editor, similar to the Mainframe Editor - File-Aid or Net-Cobols Cobol-Editor. The Editor is written in java (1.4) so should run on most Computer Systems. The RecordEditor has the following uses

  1. Viewing/editing Fixed field length data files (i.e. fields occupy the same columns in every record. A typical file might be- Columns 1 to 8 Product, Columns 9 to 16 Quantity etc).
  2. Viewing/editing CSV (i.e. Comma / Tab separated fields) files
  3. Reading / Writing Record orientated files in JAVA.

This program uses a Record-Layout definition to display the data file in a Human Readable Form. It can handle both PC (Text and Binary) and native IBM Mainframe (Text and Binary) file formats.

These Record-Layouts are stored in a Database. There is an option to import Cobol Record Layouts into the Database plus screens to edit the Record Layouts.

Fixed Field Length data files are very common :

But at work we also use them for

I believe the people working in the following areas will find this program very useful:


Starting the Record Editor

The Record Editor can either be started from

When the Record Editor starts, it displays the Edit Start Screen

Fields on this screen are

Field

Description

File

Name of the file to edit, you can select a file by using the Find File button to the right.

Database

The system stores it's record definitions in a database. The system can also connect to multiple Databases. This Combo allows you which DB to use. You could have different Test / Production Layout DB's.

System

The Record Layouts can be grouped into different systems. This Combo Box is used to select a specific System.

Record Layout

The Record Layout used to format the file. Only layouts belonging to the selected System (above) are displayed.

Note: A Record Layout describes the format of a file, each layout consists of either

  • A series of fields.
  • A serious of record (which intern consist of a series of fields).

Buttons on the Screen

Button

Description

Choose File

Start the File Chooser dialogue which will navigate the File system and the user to choose a file.

Reload

Reloads System and Record Layout details from the database.

Layout Wizard

Start the Record Creation wizard. This wizard displays the file and lets you select the fields (by clicking on the first character in the field). See "Layout Wizard" for more detail.

Note: This option is only available in the Full Editor.

Create Layout

Bring up the Record Layout Creation screen. See "Record Layout Definition" for more detail.

Note: This option is only available in the Full Editor.

Edit

Edit the file.

Browse

View the file, but no changes are possible.


Supplied Sample Files

In the $IntallDirectory/SampleFiles there are a number of example files for you try out the Editor.


File System Record Layout
Ams_Receipt.txt AMS ams Receipt
Ams_PODownload_20050101.txt AMS ams PO Download
Ams_PODownload_20041231.txt AMS ams PO Download
Ams_LocDownload_20041228.txt AMS ams Store
Ams_Shipping_04DEC03190126.txt AMS ams Shipping Upload
Ams_Shipping_04DEC02190132.txt AMS ams Shipping Upload
Ams_Shipping_04DEC01190125.txt AMS ams Shipping Upload
Ams_VendorDownload_20041229.txt AMS ams Vendor Download
Pos_Spl_1.bin POS SPL
Pos_Spl_2.bin POS SPL
Pos_Price_2.bin POS Price
Pos_Price_1.bin POS Price
DTAR119_keyode.bin Mainframe DTAR119
DTAR020.bin Mainframe DTAR020
DTAR107.bin Mainframe DTAR107
DTAR192.bin Mainframe DTAR192
sampleEbcdicNew.bin Mainframe Mainframe FB80


Viewing a Binary File

In jEdit a binary file like a 4680/4690-Register price change file looks like

Table View - Binary file

While in the RecordEditor Table-View, binary fields are converted to there text equivalent. It looks like

 

The important parts of the screen are


Layout combo
Used to select the Record Layout used to format the file
Edit Buttons (edit mode)
Various Edit options- Find, Filter, Save, Save-As / Export, Copy, Paste, New-Record, Correct-length, Delete and Help.
See "Search Screen", "Filter Screen" and "Save AS / Export" for more details.
Edit Buttons (Browse mode)
Various Edit options- Find, Filter, Save-As / Export, Copy and Help. See "Search Screen", "Filter Screen" and "Save AS / Export" for more details.
Selection Buttons
On the Far Left (just left of the line number) is the record selection Button. When one of these buttons is pressed, the record screen (see "Record View - Binary file" and "Record View - Text file") is displayed.
Headings
At the top in the column headings you can:

  • Move the Column by dragging and dropping the column header:
    • Click on the column header
    • While holding the mouse button down, drag the column to the required position

  • Change the column size by dragging the column header edge.

  • Sort on the column by double clicking on the column heading.

Viewing Text File

While a text file can be read using any editor, it can be hard to interpret as in the following example:

 
FHSTDREC01TAR05/03/200519:00:09
RHTAR297853      96010019809740001138504.03.200520.28.10000005965IN                              000000000000000000000000000                    00013776000000002800000002800                    NNY0000028 L96010082005-03-04-20.34.46.709398000000001000000000
RDTAR297853      9601001980974000000022013240000000000001EN00000002800000100000000049200EQBD180 2005-03-04-20.30.05.644995000000014
RSTAR297853      96010019809740000000220132400000000000015036000000001000000001EQBD180 2005-03-04-20.30.05.580496000000001
RSTAR297853      96010019809740000000220132400000000000015043000000003000000003EQBD180 2005-03-04-20.30.05.619864000000003
RSTAR297853      96010019809740000000220132400000000000015045000000003000000003EQBD180 2005-03-04-20.30.05.619972000000003
RSTAR297853      96010019809740000000220132400000000000015057000000001000000001EQBD180 2005-03-04-20.30.05.620098000000001
RSTAR297853      96010019809740000000220132400000000000015065000000002000000002EQBD180 2005-03-04-20.30.05.620227000000002
RSTAR297853      96010019809740000000220132400000000000015069000000002000000002EQBD180 2005-03-04-20.30.05.620324000000002
RSTAR297853      96010019809740000000220132400000000000015072000000003000000003EQBD180 2005-03-04-20.30.05.620420000000003
RSTAR297853      96010019809740000000220132400000000000015076000000002000000002EQBD180 2005-03-04-20.30.05.620515000000002
RSTAR297853      96010019809740000000220132400000000000015079000000001000000001EQBD180 2005-03-04-20.30.05.620628000000001
RSTAR297853      96010019809740000000220132400000000000015094000000003000000003EQBD180 2005-03-04-20.30.05.644403000000003
RSTAR297853      96010019809740000000220132400000000000015128000000003000000003EQBD180 2005-03-04-20.30.05.644520000000003
RSTAR297853      96010019809740000000220132400000000000015151000000001000000001EQBD180 2005-03-04-20.30.05.644617000000001
RSTAR297853      96010019809740000000220132400000000000015173000000001000000001EQBD180 2005-03-04-20.30.05.644712000000001
RSTAR297853      96010019809740000000220132400000000000015180000000002000000002EQBD180 2005-03-04-20.30.05.644819000000002
 
 

Table View - Text file

While the same file viewed in the record Editor can look like (Table View):

Record View - Text file

To display a singe record in record view (as below), press the button to the left of the row.

Record View - Binary file

To display a singe record in record view (as below), press the button to the left of the row on the "Table View - Binary file" screen.

 

The top of the Record screen is basically the same as those on the "Table View - Binary file" screen. At the bottom of the screen is the


Movement Buttons
At the bottom of the screen, is the various record movement buttons:
  • First record
  • Previous Record
  • Next Record
  • Last Record

Note: Only changes in the data column are accepted by the system.

 

CSV Files

CSV files are supported in several ways

Generic CSV Layout

On this screen you enter the details of the CSV files

Field Seperator

Character used to seperate the fields on each line

Quote

Character used to surround text fields

Parser

Line Parser used to break fields. In most cases Basic Parser will do. Parser - Matching quotes will break lines up by matching up all the quotes. Parser - Quotes Based on Field Type will put quotes arround all Character fields.

Fields on First Line

Indicates wether the first line of the file holds the field names.

Popup Menu

Both the Table File View and Record File View have a popup menu's (right click button on Windows) for running record (ie line oriented) commands.



Options include:

Copy Record(s)

Copy one or more records to the RecordEditor's internal clipboard.

Cut Record(s)

Cut one or more records to the RecordEditor's internal clipboard.

Paste Record(s)

Paste records held in the RecordEditor's internal clipboard after the current record.

Paste Record(s) Prior

Paste records held in the RecordEditor's internal clipboard before the current record.

Insert Record

Insert a record after the current record.

Delete Record(s)

Delete highlighted records (or the record being updated in record view).

Find

Start search dialogue. See "Search Screen" for more details.

Filter

Create a filtered view of the file. See "Filter Screen" for more details.

Save

Saves the selected records to the file in a variety of formats. See "Save AS / Export" for more details.

Sort

Sort dialog - sorts the file

Edit Record

Edit the record under the cursor in the Single Record Screen. See "Record View - Binary file" for more details.

Autofit Columns

Sets the column widths based on the data in the columns

Fix Column

Move the column to the left of screen and stop it scrolling off the screen when you scroll right or left.

Hide Columns

Hide the column under the cursor

Show Column

Redisplay a "Hidden " column.

The right click button will Fix a column so it will not scroll of the screen when you scroll left or right.

Search Screen

The Search screen is used to search for a value in the file. This screen is displayed when the search button ("Table View - Binary file") is pressed -



The system can do to types of searches
Full Line Search If no field is specified, the system does a Text based full line search.
Field Search If a field is specified then
  • Only the specified field is searched
  • The field is converted to text before being searched. This means that Binary fields can be searched.

Fields on this screen are

Field

Description

Search For

Text to be searched for

Replace With

Replacement text.

Record Layout

Record Layout to be used in the search

Field

Field to be searched, leave blank to do a text search on the whole record. Select All Fields to search all fields (preferred record layout).

Where

What to compare options are:

Any part of field

search for the text anywhere in the field

Whole Field

Compare the whole field with the search text.

For example, if the search text was 33 and the field contains 1331 Then Whole Field would skip this record while Any part of field would find it.

Direction

Direction of the Search, options are Forward and Backward.

Note: You can only use the replace function when you specify a specific field

Filter Screen

The Filter screen is used to created a view of the data with only the record / fields the user wants.



The important parts of the screen are:


Record Filter

This section of the screen has 2 functions

  1. Select which records to display based on the Record Type (using the Include Check box).
  2. When you click on a record you can
    • Select which fields (for this record type) will be displayed.
    • Allows you to enter filters based on a records content for this record type.

Field Filter

This section of the screen allows you to select which fields will be displayed (using the Include Check box).

Clicking on the record PriceR 1 (in the record filter above) will display the fields of record PriceR 1.


Field Value Filter

This section of the screen allows you to select which record will be displayed based on record content.

In the above example, only records where the field description contains DVD will be displayed.

Clicking on the record PriceR 1 (in the record filter above) will alloy you to enter Data-based filters for PriceR 1

You can enter up to 4 data filters per record type. A record must satisfy all filters (i.e. a logical And) to be displayed.

Sace Button The save button saves the Filter definition as a XML file. You can execute the filter at a later date from the View Menu. See "View Menu" for more details.

See "Creating Simple Reports" for example of using the filter option.

Save AS / Export

The Save As screen allows you to save

As a (Format determined by the Tab)

Save as Screen:


Field Description
File Name Holds the output file name.
What to Save Determines what is saved. Options are

File

save the full file

Current View

Saves the current view of the file.

Selected Records

Saves the selected records (or the current record if called from the Record Screen, see "Record View - Binary file").

Note: Only options that are available are displayed, so if there are no selected records, the option is not displayed.


Output Format Holds the output Format to be used. Options are:

Data

Saves the file as a Data file (i.e. the same format as the input file).

HTML: 1 table

Saves the file as single HTML table as below

Line1 : 2
Record Type
3 : 9
Pack Qty
12 : 13
Pack Cost
25 : 13
APN
39 : 8
Product
101 : 50
Product Name
1H145349.00006060286225409090 
2D17.00000.0002222250000000043314531 DONKEY 24-006607 SHWL WRAP CARD
3D14.0000148.320005614944 MILK 24-006607 SHWL WRAP CARD

HTML: 1 Row Per Table

Saves the file as single HTML table as below

Record 1

FieldStartLenDataText
Record Type12H1H1
Vendor3560600000006060
PO810286225286225
Entry Date1812040909040909
Expected Receipt Date306050102050102
Cancel by date368050107050107
Department Name442LADIES KNILADIES KNI

 

Record 2

FieldStartLenDataText
Record Type12D1D1
Pack Qty397.0000000070000
Pack Cost12130.00020000000000002
APN251322225000000002222500000000
Product3814331453143314531
Product Name398 DONKEY 24-006607 SHWL WRAP CARD DONKEY 24-006607 SHWL WRAP CARD

 

Record 3

FieldStartLenDataText
Record Type12D1D1
Pack Qty394.0000000040000
Pack Cost1213148.32000000001483200
APN251300000000000000
Product381561494405614944
Product Name398 MILK 24-006607 SHWL WRAP CARD MILK 24-006607 SHWL WRAP CARD


Sort Panel

You can start the Sort option from either the Right Click Menu and from the Data Drop down Menu. On this screen you specify which fields to sort on.

The Screen consists of

View Menu

The view menu is used to select alternative display formats for the rows that are currently selected in the editor. See the folowing sections for details on the various views available.

It also allows you to execute saved Filters, Sort Tree's and Record Tree's

Field Tree

A field Tree is like the Sort Tree (except there is no sort). It will group records with the same field values together as a Tree.

The Screen consists of

Sort Tree

Sort Tree view is a way to summarise the Data in a File. The program will sort the file and group records with the same sort Keys together to form a Tree. Longer Term I hope to display a Summary Record for each Tree Node.

Starting a Sort Tree view

First select the Sorted Tree View option of the View Menu.

The Screen consists of

Record Tree

A Record Tree view is a way to represent the Logical Structure of File. It is useful when

For example the Ams PO file consists of 3 records

PO Header

Purchase Order Summary record, it holds Purchase order details like PO number, Supplier etc. Each PO record has one or more Product Records

Product

Product/DC summary. It holds Product / DC Details. Each Products Record can have multiple Store Allocations records.

Store Allocations

Holds Store Allocations (i.e. Quantity allocated to each store) organised in array.

Logically records in the Ams PO file are arranged like:

The first step is to select the Record Based Tree option on the view Menu:

On this screen you need to enter the Parent Record for each Record.

Tree View

The Tree view screen consists of 3 parts:

Button

The Button on the far left of the screen will display the line on the Single Record screen (See "Table View - Text file" for more details).

Tree

On the Left of the screen there is the Tree, you can click on a +/- button to expand/contract the node. You can also use the Fully Expand Tree option on the Right Click menu to fully Expand a tree node.

Fields

On the right of the Screen, is the fields in the line.

Column View

The Column view will display the selected records across the page rather then normal display going down the page. There is a limit of 5000 rows for the Column view.


Specialty File Formats

The specialty formats (po and tip files) where introduced in version 0.91. At this stage they still need work. They allow you to use the RecordEditor to edit its own GetText-Po and TipOfTheDay files.

GetText Po files

The RecordEditor can now edit GetText po files. At this stage the po-editor still needs work. It can be used to edit the RecordEditor po files. Use the RecordLayout of GetText_PO.

There are many other GetText editors (i.e poedit) offer a number of functions not offered by the RecordEditor (like Translation). At this stage the RecordEditor should be viewed as an addition to another Po-Editor rather than an alternative. The RecordEditor offer's several features of it own:

At this stage, the RecordEditor is an additional tool for editing po-files rather than as a replacement for existing tools like poedit

Po Main screen

When opening a file, 2 views are available - Full File and Fuzzy / blank records. Each view has a list of translations down the left hand side and on the right the currently selected record is displayed.

If you right click on a tab (or in the top left hand corner if there is no tab), you can move the record display to the bottom of the screen, remove / add the selected-record-display.

You can use Edit >>>> Show / Hide Fields option to display other columns like msgctxt, fuzzy, obsolete, msgidPlural etc.

Po properties.

In the properties editor, you can

SwingX Tip of the day files.

The RecordEditor can now edit SwingX JXTipOfTheDay properties files. It will display the raw Text and also a formatted Html view of the file. You can also view the file using the JXTipOfTheDay dialog.

To view a Tip-Of-The-Day property file, Set the3 Record Layout to TipDetails

All the messages are listed on the left hand side, while the currently selected message is displayed on the right. You can click on a message to have it displayed on the right hand side

If you right click on a tab (or in the top left hand corner if there is no tab), you can move the record display to the bottom of the screen, remove / add the selected-record-display.

If you right click on the table you can view the tips using Swing tip dialogue.


Layout Editor

The LayoutEdit program is used to Edit Record layouts and load Cobol Record layouts into the system.

When the Layout-Edit starts, there are two screens visible

Menu

Program menu, it used select the various options

Log

This is where any errors will be written

The options on the menu screen are


Option Description
Edit Record Layouts The main part of the program. This is where you Create / Update Record Layouts. See "Record Edit Screen" for details.
Create Record Layout This screen lets you create new record layouts. See "Record Layout Definition" for more details.
Create Record Layout Wizard
Edit Table This is where you update the Utility Table's.

Note: The only Table you should update is the System Table. See "Table Edit"

Edit Combos Edit/Create Combobox Lists. See "Combo List Edit" for more details.
Create Combos Create a new Combobox list. See "Combo Create" for more details.
Load Cobol Copybook This option will load a Cobol Copybook into the Database. See "Importing Cobol Copybooks" for details.

Note: This option is only visible if the cb2xml libraries are available

Load XML Copybook This option loads XML copybooks (produced by the cb2xml package) into the Database. See "Importing Cobol Copybooks" for details.
Upgrade This option will upgrade the backend database to the latest version. This only needs to be run once if you upgrade (rather than reinstalling the package). The 2 options available are
  1. Upgrade Database Structure (from pre 0.52 versions database structure) to the latest structure (introduced in version 0.52)
  2. Update line separator to default. Version 0.52.1 alowed you to specify the line separator to be used in all files (not just binary files). The possible separators are:
    default Use the computers normal (or default) line separator.
    <crlf> Windows style separator.
    <cr> Unix/Linux file separator.
    <lf> Macintosh line separator.


Record Layout Definition

The record layout Definition screen is used to create new Record Layouts or edit specific layouts.

The fields on this section of the screen are:

Field

Description

Buttons

The buttons at the top of Record Screen Save, Create, Repeat, Delete and reload Record Details to/from the Database.

Record Name & Description

Self Evident

Record Type

There are 3 basic Record Types (+ binary versions of these):

Record Layout

A normal record consisting of a one or more fixed length fields.

Delimited

Standard Delimiter (i.e. Comma or Tab Delimited) Record. Delimiter files are only partially supported (no updates allowed).

Group of Records

The record consists of a Group of other records. Typically there is a field that determines what record to use. It is common for a file to contain

  • A File Header Record
  • Many Detail Records
  • A file trailer record

This would be a good candidate for using a Group of Records. In this case you would define 4 records:

  • File Header Record
  • Detail Record
  • Trailer Record
  • Master Record (Group of Records) that references the three previous (child) records.

See "Child Records" for the Child Record Definition screen section.

System

System this Record Layout belongs to. You can Change Create new systems by updating the System Table via the "Table Edit"

Lines to Insert

This is the lines to insert in the Field Table / Sub-Record Table when the insert button (just below) is pressed.

Table Buttons

The second row of buttons refer to the Field Table / Sub-Record Table immediately below the buttons

Record Details

Lastly we have a Tab Box holding the "Field Records"/"Child Records" tables + the "Extra Panel". These panels define record details.

Note: The "Child Records" panel is displayed when Record Type=Group of Records or Group of Binary records Records otherwise "Field Records" is displayed.

Field Records

This panel is used to define the records fields. Fields in the Table are:


Field Description
Position Position in the Record. The start of the record is Postion=1 and not 0 as in C / Java.
Length Length of the field in bytes. Leave blank for Comma / Tab (etc) delimited files
Field Name Name of the field. This is the column/row name used for this field in the RecorEditor
Description Field Description. This is used as a Column Header Mouse over in the Record editor. For example if the description was entered as

Then if you hold the cursor over the column heading in the RecordEditor you get

Field Type Type of Field. See Appendix B, "Field Types" for details.
Decimal Pos Number of places after the decimal point
Cell Format Formatting to be applied to this field.
Parameter User parameter's. This is a value that can be used by user written types (e.g. for generic Combo or Date Routines).
Default Value Information only, Not currently used (relates to work).
Cobol Name Information only, Cobol Field Name
Field Id Do not Change. It is the field key and is displayed for my testing.

 

Child Records

This panel is displayed when Record Type=Group of Records or Group of Binary records Records. Fields in the Table are:


Field Description
Child Record The child record of the Current parent record
Field Start Not Currently used
Field Field that determines which record to use. In the above example:
  1. The records DCR0470 S11 .. S14, O21 each contain a field Record Type
  2. When editing a file where Record Type="S11" then the RecordLayout of DCR0470 S11 would be used.
    While if Record Type="S13" then the RecordLayout of DCR0470 s13 would be used.
FieldValue Field value that the Field above is tested against.

Extended Record Selection Button - Starts the Extended Record Selection dialog
Tree Parent Logical Parent Record for the record. This can be used to build a Tree using the Record Layout Tree option of the View menu in the RecordEditor

Note: if Field is blank and FieldValue=* then this is the default record.

 

Record Selection Screen

To start the Record selection editor Press the appropriate button on the record group screen:

On the record Selection you enter fields and the criteria

For the Field, operator and value fields just enter the values. For the And / Or value you can change by clicking on the And / Or, it will swap

The screen only supports simple expressions of the form

        (     field1 = value1
          and field2 = value2
          and field3 > value3
         )
      or (    field4 < value4
          and field5 > value5
         )
      or (    field6 = value6
          and field7 > field8
             ..........
 

The system only supports simple Or ~ And boolean expressions. It does not support complicated expressions or And ~ Or boolean expressions.

If Field values are entered at the Group level They will be included as well.

The above will be interpreted as

       Record Type = S1
  and
      (
          (    Case Pack id  = P
           and Pack Qty      > 0
          )
       or (    Case Pack id  = S
           and Pack Qty      < 0
          )
      )
 
 

Extra Panel

On the extra panel contains an adhoc mixture of options


Field Description
Cobol Copybook Cobol Copybook name (if imported from a Cobol/XML Copybook). When a Cobol copybook is imported the LayoutEdit will replace an existing file with the same name.
Font Name Font Name to be used. If it is blank, the System default font will be used. A typical use might be to display Native mainframe data on a PC.
Delimiter Delimiter to use in Delimited files (i.e. comma, tab etc).
Quote Quote character to use in delimited files.
Record Separator Record Separator to use.
default Use the computers normal (or default) line separator.
<crlf> Windows style separator.
<cr> Unix/Linux file separator.
<lf> Macintosh line separator.
File Structure Structure of the files. Controls which IO routines are used to read / write the file. File Structures are defined in Table 5.

Defining Combo Field

To use a Combo List (Say AmsPoDownloadType) you must

  1. Set the Cell Format to Combobox

  2. Enter Combo list in the Parameter Field


Record Edit Screen

The Record Editor looks like

This screen consists of three parts


Section Description
Top Left This is the Record Selection This is where you enter selection options to limit what is displayed in the Record List. To display all records starting with t; enter t% in the Record Name field.


Bottom Left This is the Record List panel You can select a record to be displayed by clicking on it

Right On the right part of the screen is Record Definition.

The fields on this section of the screen are:

Field

Description

Buttons

The buttons at the top of Record Screen Save, Create, Repeat, Delete and reload Record Details to/from the Database.

Record Name & Description

Self Evident

Record Type

There are 3 basic Record Types (+ binary versions of these):

Record Layout

A normal record consisting of a one or more fixed length fields.

Delimited

Standard Delimiter (i.e. Comma or Tab Delimited) Record. Delimiter files are only partially supported (no updates allowed).

Group of Records

The record consists of a Group of other records. Typically there is a field that determines what record to use. It is common for a file to contain

  • A File Header Record
  • Many Detail Records
  • A file trailer record

This would be a good candidate for using a Group of Records. In this case you would define 4 records:

  • File Header Record
  • Detail Record
  • Trailer Record
  • Master Record (Group of Records) that references the three previous (child) records.

See "Child Records" for the Child Record Definition screen section.

System

System this Record Layout belongs to. You can Change Create new systems by updating the System Table via the "Table Edit"

Lines to Insert

This is the lines to insert in the Field Table / Sub-Record Table when the insert button (just below) is pressed.

Table Buttons

The second row of buttons refer to the Field Table / Sub-Record Table immediately below the buttons

Record Details

Lastly we have a Tab Box holding the "Field Records"/"Child Records" tables + the "Extra Panel". These panels define record details.

Note: The "Child Records" panel is displayed when Record Type=Group of Records or Group of Binary records Records otherwise "Field Records" is displayed.

Note: See "Record Layout Definition" for more details.


Layout Wizard

The Record Layout Wizard guides you through creating a record layout using a file as the basis. On all the wizard screens, you can use Left and Right Arrow buttons (at the bottom of the screen) to move between the screens. There are 2 basic groups of Screens:

Fixed Width

Screens for defining Fixed field width Files. See "Field Position screen" and "Field Definition screen".

CSV

Screens for defining a CSV file. See "CSV Details" and "CSV Field Definition"

Multi Record

Screen for defining files with multiple Records in them. See "Record Type Field", "Record Name screen", "Field Position screen" and "Field Definition screen".

Initial Wizard Screen

On the file screen you enter file details and the name of the record layout being created. The field Record Types determines whether you travel down the

Fixed Width

route ("Field Position screen" and "Field Definition screen") screens

CSV

route ("CSV Details" and "CSV Field Definition").

Multi Record

route ("Record Type Field", "Record Type Field", "Record Name screen", "Field Position screen" and "Field Definition screen").

Fields on the window are:

File Name

Name of the file you are building a layout for

File Structure

How the file is organized. If you are using Standard Windows / Linux Text files leave it as Default Reader

Record Type

This is where you select what type of records are in the file. The options are

  • Fixed Length Records For a file with one record with fixed width fields. See "Fixed Width Dialogue" for more details.
  • Delimited Fields For a file with delimited Fields. See "CSV Dialogue" for more details.
  • Multiple Record (Fixed Width) For files with multiple Fixed With Records in them. See "Multiple Record Screen" for more details.

Font Name

Font Name of the file (e.g. CP037 for US Ebcdic Characters).

Default Type

What Types Fields to initially assign to a field.

File Structure Screen

If you are using Windows/Unix files, you will not see this screen. Its displayed when

Fields on the window are:

File Structure

The Structure or Format of the file

Length

Record Length for fixed width files. You can also set this field by clicking on a position in the file Table

Font Name

Files Font, typically cp037 for Mainframe files (US EBCDIC).

Fixed Width Dialogue

Following are the wizard screens displayed when using a fixed width file.

Field Position screen

The second screen displays the file with the fields in alternating background colors.

To create a new field, click on the first column of the field.

To remove a field, click on the first column again

Other Fields Buttons on the screen include:

Note: The initial values of the Search For + whether a search is done automatically is set in the Edit >>>> Edit Startup Options dialog. See "Startup Options" for more details

Field Definition screen

This screen is for defining the field names and field types.

Once all the fields have been defined, click on the right arrow button to define the new layout.

Save screen

On the final screen you define the layout name and layout description

CSV Dialogue

CSV Details

On this screen you specify the basic CSV file structure (i.e. field separator; quotes).

Fields on the Screen

Field Separator

Field used to mark the end of one field and the start of the next

Quote Character

Quote character used to surround Text Fields

Parser

Parser used to split lines up into fields. For most files, the Basic Parser is the best to use. But the three parsers provided are:

Basic Parser

If Field starts with a Quote, it looks for a <Quote><Separator>. It will fail if a field contains <quote><separator>

Matching Quotes

For every opening Quote, It looks for a matching closing Quote.

Quotes based on fields

This is an extension of Matching Quotes. For this type of Parser all text fields will always get quotes around them. This is programs that are very picky about having Quotes around Text fields, Dates (in particular some Databases).

Fields on First Line

Indicates whether the first line of the file holds the field names.

CSV Field Definition

This screen is used to define the fields (columns) in the file.

Layout screen

On the final screen you define the layout name and layout description

Multiple Record Screen

Following are the Wizard screens displayed when working a Multi-Record Fixed Field width Data file.

Record Type Field

This screen is used to define where the Record-Type Field (the field that determines what type of record it is). You can do one of

Record Name screen

This screen lets you define the names of the various records.

Field Position screen

This screen displays the file with the fields in alternating background colors.

To create a new field, click on the first column of the field.

To remove a field, click on the first column again

Other Fields Buttons on the screen include:

Note: The initial values of the Search For + whether a search is done automatically is set in the Edit >>>> Edit Startup Options dialog. See "Startup Options" for more details

Field Definition screen

This screen is for defining the field names and field types.

Once all the fields have been defined, click on the right arrow button to define the new layout. Use the Record combo to switch between the various records.

Save Layout screen

On the final screen you define the layout name and layout description

Startup Options

There are several Wizard Field Search options that can be set via the Edit Startup options function (Edit >>>> Edit Startup Options Menu).

The Parameters that can be set are:


Combo List Edit

Combolists are used to define a list Combobox Items. They can be used to define all the options available for a field in the Record Editor. See "Defining Combo Field" for details of how to use a Combo.

The Screen is divided into two parts:

Combo Search

Used to find and select the Combo List to be editted. See "Combo Selection Panel" for more details.

Edit

Used to update the Combo Lists. See "Combo Edit Panel" for more details.

Combo Selection Panel

This panel is used select the combo Lists to display and edit.

Fields

Combo Name

This field is used to limit what is displayed in the List. You can\ use % character as a wildcard.

System

Used to restrict the List to Combos in a specific system.

List

Used to Select which list to edit.

Combo Edit Panel

Used to update a combo list

Fields on the Screen

System

System this Combo List belongs to. It is only used for searching.

Combo Name

Name of the Combo List. It used to refence this list in the field definition screen

Combo Type

Type of Combobox to display

Standard Combo

Display a list of possible Values. The Selected Value is what gets put in the file.

Key/Value Combo

With these Combos the values displayed to the user are different from what the file holds. In the above example, Combo Code holds the file value while Combo Value holds the value displayed to the User. So the File would hold H1 while the user sees PO Header (H1).

Insert Lines

The number of lines to insert

Table Buttons

The second row of buttons refer to the Field Table / Sub-Record Table immediately below the buttons

Table

Combo Items to be displayed in the Combobox

Defining a Combo Field

To use your Combo List (Say AmsPoDownloadType) in a Record Layout (Copybook) definition, you must

Please look at How To use Combos for more details.


Combo Create

This screen is used to create new Combo Lists, please see "Combo Edit Panel" for more details.

 


Table Edit

The RecordEditor / LayoutEdit uses a Table-Database to store common details (like Record-Types, Field Types and Systems). You can use the Table Editor to update the information in the Table-Database.


Number Table Description
1 FldType Field Types supported. See the example manual and java example XmplType1.java on adding new Types to the editor.
2 RecordType Record Types ~ do not change this table
3 Systems Define your Systems. Systems allow you to divide your copybooks up into related groups
4 FileStructure File Structures table. See the example manual or XmplFileStructure.Java for details on adding new file structures.
5 Formats Table Cell formats. These are used to format table cells in the Record Editor See the example manual for details

You can select a table to be updated by clicking on the Table in the list on the left

The Lines to Insert Field holds the lines to be inserted in the JTable at the bottom of the when the Insert button is pressed.

The Insert, Delete, Copy and Paste buttons all act on the Table at the bottom of the screen.


Number Name Description
1 Field Type Field types used in the Editor. When defining Types you must update this table. User defined types should be in the range 1000 --> 1050.
2 Record Type Record types used in the editor, do not change this table
3 System Systems or Applications, change this table in anyway you like
4 File Structures File Structures used in the system. I suggest if you create your own file structures use Row Key > 1000.

The file structure controls which IO routines are used to read / write the file. See class net.sf.RecordEditor.record.io.LineIOProvider

5 Table Cell Formatting Table Cell formats are used to format / edit table cells. It allows checkbox / comboboxs / etc in the RecordEditor.

User defined formats should use Row Key > 1000.


Section Description
Left

In this section you select which table to edit by clicking on it.

Top Right

In this section you update a Table Header Details

Bottom Right

In this section you update a Table Row Details. The Columns are:

Row Key

Table Row Key. For the Field Type / Table Type tables this value is also Hard Coded in the program so do not Change.

Details

Description, this value is displayed in various Combo Box's, you can change this to anything you like.


Load Cobol Copybook

The Cobol imports Cobol Copybooks into the RecordEditor. Currently Mainframe and Fujitsu Cobol dialects are supported.

The fields on the Import screen are

Field

Description

Copybook

The copybook File to be imported.

Choose File Button

Display the file search screen so you can find the input file.

Split Copybook

Controls wether the copybook will be split into a Parent Record and separate Child-Records or stored as a single record. Options are:
No Split Record is stored as a single record.
On Redefine Record is split into separate records on the first redefine.
On 01 level Record is split into separate records on 01 level records.

Font Name

Font Name to use when editing this file. You would only need to enter a Font Name if you are editing a IBM Mainframe File on a PC (or editing a PC file on the mainframe). For UA / Canada / Australia the mainframe Font Name is CP037

Binary Format

Binary Format to use (i.e. wether Cobol comp fields are converted to a PC little Endian or Mainframe / Java / AIX big Endian format).

File Structure

File Format or structure. It actual chooses the File reader used. Unless you are using Native Mainframe, Fujitsu Cobol or Binary files, leave it as Defult Reader.

System

System to assign the Copybook to.

Go Button

Import the file

When the Split Copybook on Redefine is set, then a copybook like

        02  The-Record.
	    03 Record-Type                    Pic X.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
	    03 Detail-Record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
	       05 ...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
	    03 Header-Record  redefines  Detail-Record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
	       05 ...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
	    03 Footer-Record  redefines  Detail-Record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
	       05 ...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

will be imported as


Load Copybook Choose Format

In the Load Copybook Choose Format You can select from a variety of Copybook Formats.

Copybook formats available include:

cb2xml XML Copybook

This is basically Cobol converted to XML. It is produced by the cb2xml package.

Cobol

Cobol Copybook source code.

XML

This option reads a XML file and creates a copybook for viewing / editing similar XML files

DB Csv Extract

Primary an extract from a DB2. It allows you to view / edit Delimitered extracts from DB2. See "DB CSV Copybook format" for more details.

Comma CSV

A description of a Comma Delimitered CSV file with Field names on a single line seperated by Commas.

Tab CSV

A description of a Tab Delimitered CSV file with Field names on a single line seperated by Tabs.

RecordEditor CSV Copybook

Both Comma and Tab Delimitered formats supported. This is a CSV file produced by the "Copy Copybooks" option of the LayoutEditor.
It is basically Field: Position, Length, Name, Description, Field Type, Decimal, the same as in the Record Definition screen. see "RecordEditor CSV Copybook Format" for more details.

The fields on the Import screen are

Field

Description

Copybook Type

The Type of Copybook.

Copybook

The copybook File to be imported.

Choose File Button

Display the file search screen so you can find the input file.

Split Copybook

Controls wether the copybook will be split into a Parent Record and separate Child-Records or stored as a single record. Options are:
No Split Record is stored as a single record.
On Redefine Record is split into separate records on the first redefine.
On 01 level Record is split into separate records on 01 level records.

Font Name

Font Name to use when editing this file. You would only need to enter a Font Name if you are editing a IBM Mainframe File on a PC (or editing a PC file on the mainframe). For UA / Canada / Australia the mainframe Font Name is CP037

Binary Format

Binary Format to use (i.e. wether Cobol comp fields are converted to a PC little Endian or Mainframe / Java / AIX big Endian format).

File Structure

File Format or structure. It actual chooses the File reader used. Unless you are using Native Mainframe, Fujitsu Cobol or Binary files, leave it as Defult Reader.

System

System to assign the Copybook to.

Go Button

Import the file


Copy Copybooks

This option is used to copy Copybooks (RecordLayouts):

  1. From one Database to an other (if you have more than on Database defined).

  2. To a file in the RecordEditor CSV format. This file can be loaded back into the record Editor via the LayoutEditor "Load Copybook Choose Format" option.

  3. To a file using a Velocity Template ( See Installing Velocity). There is one supplied template to print a RecordLayout as HTML

In the example below, All layout starting with ams shp Upload will copied to files in the directory C:\Program Files\RecordEdit\MSaccess\CopyBook\csv\

The Screen consists of 2 Panels:

Source

On the left is the Source Panel where you specify Copybooks to be copied. You select the Source DB and specify the copybook(s); you can use % as a wild card.

Destination

In the right hand panel you specify the destination. The fields are

Database

Destination Database or File or Velocity.

Note: Velocity needs to be downloaded seperately. See Installing Velocity for details.

Output Format

For Output File format. It is only available when Database=File.

Output Directory

The output directory when Database= File or Velocity .

Extension

The File Extension for writing Velocity based output.

Velocity Template

The Velocity Template to format the Copybook with.


DB CSV Copybook format

The DB Format is for viewing / editing DB2-UDB delimited table exports files. A file can be created with the following SQL:

   1:EXPORT TO "C:\Bruce\RecordEditor\Db2Fields.txt" OF DEL MESSAGES "C:\export.txt"
   2:SELECT 'DB_DVMT_' || c.TABSCHEMA, c.TABNAME, c.COLNAME, c.COLNO, c.TYPENAME, c.LENGTH, c.SCALE
   3:  FROM SYSCAT.COLUMNS AS c
   4: where c.TABSCHEMA = 'ETB'
   5: ORDER BY c.TABSCHEMA ASC, c.TABNAME ASC, c.COLNO ASC
   6:

Or alternatively the following SQL will generate SQL to create a copybook files for each table.

   1:SELECT 'EXPORT TO "C:\Data\RecordEditor\CsvCopybooks\'  || TabName || '.Csv" OF DEL MESSAGES "C:\export.txt"  '
   2:    || 'SELECT ''DB_DVMT_'' || c.TABSCHEMA, c.TABNAME, c.COLNAME, c.COLNO, c.TYPENAME, c.LENGTH, c.SCALE '
   3:    ||  ' FROM SYSCAT.COLUMNS AS c '
   4:    || ' where c.TABSCHEMA = ''' || TABSCHEMA || ''' and c.TABNAME = ''' || TabName || ''' '
   5:    || ' ORDER BY  c.TABNAME ASC, c.COLNO ASC; '
   6:FROM SYSCAT.TABLES where TABSCHEMA = 'ETB';;
   7:
   8:


RecordEditor CSV Copybook Format

The Record Editor is a Copybook Transfer format. You can create files in this format via the "Copy Copybooks". You can also cut from the RecordLayout editor and paste into a normal Text Editor.

The format of the file is basically

  1. Position
  2. Field Length
  3. Field Name
  4. Description
  5. Field Type
  6. Decimal - number of decimal places
  7. Cell Format
  8. Parameter


Defining Binary Files

Standard Binary Files

The RecordEditor reads Text files using standard Java Text-Read routines. These routines will convert all text fields to Java's Unicode representation. This means any binary fields read using standard Java Text-Read routines will be corrupted.

The RecordEditor has separate routines to read binary files. It uses these binary read routines when:

If you are having trouble with a binary files. I would suggest

  1. Make sure the record is either Record - Binary or Group of Binary Records.

Calculating Record Length

The RecordEditor calculates the record length by

  1. If all records are the same length (or this is one record), A constant fixed record length is used.

  2. Deciding what record it is using the field and FieldValue as defined on the "Child Records" screen.

  3. Looking for the Record Separator string (see "Extra Panel" for details) at all the possible record lengths.

  4. Searching for the record Separator.

Mainframe Files

The RecordEditor was not specifically written for the mainframe but it can edit mainframe cobol files, this means there will be a learning curve for you. It does require a full install of Java 5 or greater, some partial installs do not include charset.jar file which holds the EBCDIC translation tables. Some companies I have worked for have not installed this file on there Work PC's.

While the RecordEditor is not a replacement for FileAid, I find it a useful to use the RecordEditor instead of FileAid for some tasks for these reasons

  1. The RecordEditor works better with PC Software than FileAid. You can cut and paste from the RecordEditor into Word / Excel. Also you can export as HTML or via velocity templates.

  2. You can view a lot more of the file at any one time in the RecordEditor. On my home PC (22 inch) I can see 55 rows by 18-> 20 field columns. In FileAid its 29 rows by 3 -> 6 columns.

  3. Can produce Adhoc Reports (via sister project Flat File Reporting which is a Report Designer) from Mainframe Cobol Files.

  4. Can create different views on the file (Filter Option).

  5. For a Project I typically create a PC folder. The recordEditor lets me save (and view) any Mainframe Files for the project (e.g. Test files / Test results).

The RecordEditor is available in 2 format

Importing Cobol Copybooks

The first step in editing a file is to import the Cobol Copybook. To do this select Record Layouts >>> Load Cobol Copybook from the main menu

The next screen to be displayed includes:

Field

Description

Cobol Copybook

Spilt Copybook

How the copybook should be divided up (No Split - one record in the file; on redefine - Split into seperate record on a Redefine Statement; on 01 - split into seperate records for each 01 level).

Font Name

Blank for native files; cp037 (coded page 37) for US / Canada / Australian EBCDIC.

File Structure

Equivalent to RECFM in JCL. Can be left as Default Reader for FB and PC files. Needs to be changed for VB files.

System.

Basically a way of grouping Copybooks together in to logical systems.

Downloading FB files.

Fixed Block files can be downloaded as a binary file from the mainframe and edited in the record editor. You can set the File Structure to either Default Reader or Fixed Length Binary

Downloading VB files

The RecordEditor can edit VB files provided the RDW (record descriptor word i.e. record length) is in the file. Many file transfer protocols will drop RDW. The options for VB files are

  1. Copy to a FB file and transfer / edit this file.

  2. Transfer as a VB file (including RWD. You will need to set the File Structure to Mainframe VB (RDW based) Binary

  3. The third option is to copy VB file to a RECFM=U file and transfer this file:

    // SET IN=VB.FILE.TO.TRANSMIT
    // SET OUT=USER.&IN..RECFMU
    //*
    //STEP010 EXEC PGM=IEFBR14,COND=(0,NE)
    //SORTOUT  DD  DSN=&OUT,
    //             DISP=(MOD,DELETE),
    //             SPACE=(TRK,(30,30),RLSE),
    //             DCB=BLKSIZE=0
    //*
    //STEP020 EXEC PGM=IEBGENER,COND=(0,NE)
    //SYSUT1   DD  DSN=&IN,DISP=SHR,DCB=RECFM=U
    //SYSUT2   DD  DSN=&OUT,
    //             DISP=(NEW,CATLG),
    //             SPACE=(TRK,(115,45),RLSE)
    //SYSPRINT DD  SYSOUT=*
    //SYSOUT   DD  SYSOUT=*
    //SORTMSG  DD  SYSOUT=*
    //SYSIN    DD  DUMMY
    

    You will need to set the File Structure to Mainframe VB Dump: Includes block length

PC Cobol

The RecordEditor can edit Cobol Data files in 2 ways

  1. Via the main Editor. Cobol copybooks need to be imported into its Databases

  2. Using the Cobol Editor. This editor works directly off a Cobol Copybook but is slightly less capable than the main editor (particular for files with multiple record layouts.

Main Record Editor

Importing Cobol Copybooks 

The first step in editing a file is to import the Cobol Copybook. To do this select Record Layouts >>> Load Cobol Copybook from the main menu

The next screen to be displayed includes:

Field

Description

Cobol Copybook

Split Copybook

How the copybook should be divided up (No Split - one record in the file; on redefine - Split into separate record on a Redefine Statement; on 01 - split into separate records for each 01 level).

Font Name

Blank for native files. Normally left blank for PC files; For mainframe EBCDIC use cp037.

Binary Format

Indicates the format of Numeric fields (in particular Comp* Cobol Fields). The Values to use
Cobol Implementation Value
IBM Mainframe Cobol Mainframe
Fujitsu PC Cobol Fujitsu
Open Cobol (Default, 85 2002) Open Cobol
Open Cobol (bs2000) Open Cobol bs2000
Open Cobol MVS (with Ascii Characterset) Open Cobol MVS
Open Cobol Micro Focus Open Cobol Micro Focus
Micro Focus Cobol Open Cobol Micro Focus

File Structure

For files with a single record length use Fixed Length Binary For files with multiple records:
Cobol Implementation VB Structure
Fujitsu PC Cobol Fujitsu Variable Binary
Open Cobol (all versions) Open Cobol VB

System.

Basically a way of grouping Copybooks together in to logical systems.

Cobol Editor

The Cobol Editor (shell script runEditorFileCopybook.sh) started life as specifically using Cobol Copybooks. These days its supports Cobol Copbooks, 2 XML layout formats, 2 csv layout formats. The primary screen looks like:

Field

Description

File

File to be edited

File Structure

For files with a single record length use Fixed Length Binary For files with multiple records:
Cobol Implementation VB Structure
Fujitsu PC Cobol Fujitsu Variable Binary
Open Cobol (all versions) Open Cobol VB

Copybook Type

Format of the Record Layout. Use Cobol Copybook for Cobol Copybooks

Split Copybook

How the copybook should be divided up (No Split - one record in the file; on redefine - Split into separate record on a Redefine Statement; on 01 - split into separate records for each 01 level).

Copybook

Cobol copybook (or Record Layout description file)

Numeric Format

Indicates the format of Numeric fields (in particular Comp* Cobol Fields). The Values to use
Cobol Implementation Value
IBM Mainframe Cobol Mainframe
Fujitsu PC Cobol Fujitsu
Open Cobol (Default, 85 2002) Open Cobol
Open Cobol (bs2000) Open Cobol bs2000
Open Cobol MVS (with Ascii Character set) Open Cobol MVS
Open Cobol Micro Focus Open Cobol Micro Focus
Micro Focus Cobol Open Cobol Micro Focus

Note: Same as field as Binary format in the "Importing Cobol Copybooks" screen.

Options

There are some options that can be set to make the RecordEditor easier to use with Cobol Copybooks / files. To make these changes

JRecord Properties File.

The JRecord.properties file can be used to define a Cobol dialect (provided the types already exist in the JRecord/RecordEditor package. Each dialect definition consists of a series of assignment statments

   ###   Definition for Open Cobol
   ###  *-------------------------*
 
   CnvCode.1=151
   CnvName.1=Test Open Cobol
   CnvSizes.1=1,2,4,8
   CnvSyncSizes.1=1,2,4,8
 
 
   ###   Definition for BS2000 compiler
   ###  *------------------------------*
 
   CnvCode.1=152
   CnvName.1=BS2000
   CnvSizes.1=2,4,8
   CnvSyncSizes.1=2,4,8


Variable Description
CnvCode Integer code that uniquely identifies the Cobol Dialect. Please use values > 100 to avoid conflicts with builtin dialects
CnvName Name of the Cobol dialect. This is what appears in the combo box.
CnvSizes The sizes in bytes that are used by Comp (binary integer fields). This 2,4,8 on the mainframe while many PC Cobol compilers allow 1 byte binary fields so 1,2,4,8
SyncSizes Byte allignment positions (for the Sync keyword). The 4 numbers are
  • Where 1 byte binary numbers align to.
  • Where 2 byte binary numbers align to.
  • Where 4 byte binary numbers align to.
  • Where 8 byte binary numbers align to.
CnvFloatSync The byte where Floating point (Comp-1) variables align to
CnvDoubleSync The byte where Double (Comp-2) variables align to
CnvType The JRecord/RecordEditor Type to assign to

Pic 9, Comp, Comp-1, Comp-2, Comp-3, Comp-4, Comp-5, Comp-6

variables. Values available are

  • zd - Ascii Zoned Decimal
  • mvszd - Mainframe (EBCDIC) Zoned Decimal
  • be - Mainframe style Big Endian Binary integer
  • pbe - Mainframe Style Positive Big endian Integer
  • le - Intel style Little Endian Binary integer
  • ple - Intel Style Positive Little endian Integer
  • f - floating point number
  • d - Double
  • pd - Packed Decimal (Comp-3)
  • ppd - Packed Decimal with no Sign Nyble
  • rm - RM Cobol Comp (untested, I do not have a RM Cobol File).
  • rmp - Positive RM Cobool comp.

This field is optional. If left out, it defaults to

zd,be,f,d,pd,be,le

CnvPositiveType Types to use for positive [i.e. unsigned Pic 9(?)] variables. If left out it defaults to the CnvType variable. It has exactly the same formats and types as CnvType.


Tab/Comma Delimited Fields in Files

The RecordEditor now supports Files with Comma / Tab / etc delimited fields. There are 2 places where field names can be stored:

Standard Record Layout

Fields can be stored in the Database in the normal way. The position becomes the field number.

First line of file

Field names can be read from the first line of a file.


Defining a Delimited File

There are 4 important parts to defining files where fields are separated by a certain character:

See "Extra Panel" for details on the "Extra Panel".


Defining a Standard Delimited File

Standard Delimited record layouts are defined as below. The position holds the field number (rather than starting position).


Names on the first Line

To define files where the first line holds the field names you must define a File Structure Delimted, names on first row (which causes different file readers to be used).

The Editor comes with 2 Delimited files where names are on the first line.


Csv Array Description

Version 0.61a has a small extension to support Csv Arrays (or Csv fields with in CSV fields). i.e.

Data: field one|field two|"embedded field1, embedded field2|embedded field11,embedded field22"|field four
 
Field 1: field one
Field 2: field two
Field 3: array
   Array 1:
      Embedded Field 1: embedded field1
      Embedded Field 2: embedded field2
   Array 1:
      Embedded Field 1: embedded field11
      Embedded Field 2: embedded field 22
Field 4: field four

This can now be defined in the record Editor as:

with the extra panel as follows:

When editing a file, the field can be displayed in a "Combo Box" like dropdown window


Parameter Field

The Parameter field of a CSV array is defined as

One Dimension

<Separator>Quote<Separator>Field Separator<Separator>

One Dimension

<Separator>Quote<Separator>Field Separator 1<Separator>Field Separator 2<Separator>

Where <Separator> is any valid character.

Here is a another example


Appendix A. Help System

The RecordEditor includes a basic Form (or Form section) based help system. The help system is available via

Help Buttons

Most screens now include a Help Button on the Top right of a Form.

F1

Help is also available via Function Key-1 most of the time (exceptions include editing tables). For complicated screens (e.g. Record Layout Edit screen), F1 help is based on the whre the cursor is positioned.

The help system has 2 methods of locating its help files:

Properties Variable

The system looks for the Variable HelpDir= in the properties file. See Appendix H, "JDBC Properties file" fore more details.

Relative Directory

Relative Directory. I the RecordEditor and LayoutEdit.jar is in "C:\Programs\RecordEditor\HSQL\lib" then the system will "C:\Programs\RecordEditor\HSQL\Docs" for the help files.


Appendix B. Field Types

Field Types supported by the record editor


Id Type Name Description
0 Char Text Field
1 Char (right justified) Right Justified Text Field
2 Char Null terminated Character String that is terminated by nul (0h). C-style string.
3 Char Null padded Character String that is null padded on the right
4 Hex Hex Field (max length 8 bytes).
5 Num (Left Justified) Left justified numeric field
6 Num (Right Justified space padded) Right Justified space padded Numeric field
7 Num (Right Justified zero padded) Right Justified zero padded Numeric field
8 Num Assumed Decimal (Zero padded) Right Justified zero padded Numeric field with an assumed Decimal space
9 Num Sign Separate Leading Numeric Sign separate from the field and at the front.
10 Num Sign Separate Trailing Numeric Sign separate from the field and at the end of the field.
11 Decimal Unsigned Decimal (i.e. 121 is represented as hex x'0121'
15 Binary Integer PC format (i.e. Low to High) Binary integer. A value of 255 is represented as hex x'FF00'.
16 Positive Binary Integer PC format positive Integer
17 Float Standard Floating point number
18 Double Standard Double
21 Bit Show the individual bits.
31 Mainframe Packed Decimal (comp-3) Mainframe packed decimal (Pic s9(#) comp-3 in mainframe Cobol). In this format, 255 would be stored as hex x'255F'
32 Mainframe Zoned Numeric Corresponds to Cobol PIC S999. on the mainframe.

The format dates to the Punch Card days when a fields sign was entered by over punching the last byte of a numeric field. This saved 1 byte per numeric field - big advantages in the 1960's.

35 Binary Integer Big Endian (Mainframe, AIX etc) Standard Java / Mainframe / Power PC /etc Binary Integer. The number of is stored as high to low format i.e. 255 is stored as hex x'00FF'.
41 Fujitsu Zoned Numeric Fujitsu Cobol Zoned Numeric
71 Date - Date Format is held in Parameter field (on the record Definition table).
72 Date - Format YYMMDD
73 Date - Format YYYYMMDD
74 Date - Format DDMMYY
75 Date - Format DDMMYYYY
110 Check Box True / Space
111 Checkbox Y/N for a Y/N field (ie Yes / No)
112 Checkbox T/F for a T/F field (ie True / False)
115 CSV array
116 XML Name Tag
117 Edit Multi Line field Display a text file that contains more than one line. It primarly for XML files.

Note: At this stage, the maximum editable size of all binary fields is 8 bytes.


Appendix C. Record Layout Details

The system use Record-Layout descriptions stored in a Database to format the file. Logically there are 2 types of records (each type has both Binary and Text Version)


Standard Record Group of records
Standard records consist of one or more fields. Each field consists of a
Position Where the field starts in the record. The lowest possible position is 1.
Length The fields length
Name Field name. This is displayed as a Column / Row Heading in the record editor
Field Type File type i.e. Char, Numeric.
Group-Records consist of one or more Records. This Record-Type is used when a file consists of more than one record structure. A typical case when to use would be if a file consists of
  • A File header Record
  • A Large number of detail records
  • A file trailer record.




Appendix D. FAQ

Question

Can I get help with using the editor

Answer

Yes, got to the RecordEditor forum http://sourceforge.net/projects/record-editor/forums and ask away

Question

Can I suggestions or request changes

Answer

Yes, either

Question

Why are there no options in System Combo Box

Answer

This probably means the system cannot connect to the Database. This could be due to

  • Database has not been started (MySQL, HSQL etc)
  • The db Connection is not set up correctly; see the RecEdit.properties in the RecordEdit.Jar and LayoutEdit.Jar
  • The MS-Access Database is moved (MS-Access version). This will break the ODBC definition. The solution is to update the ODBC Definition

Question

How do I create a layout

Answer

There are a number of ways.

  • If you have a sample file, use the Layout Wizard

  • Use the LayoutEditor (either from the Windows / linux start button) or from the Layout Menu

Question

Why can't I see my layout in the Editor

Answer

There are 2 possible causes:

  1. Have you reloaded the Database in the editor ???

  2. Have you selected list in the layout Screen ???

Question

Can I load Cobol Copybooks into the DB in batch

Answer

Yes,

  java -jar run.jar net.sf.RecordEditor.layoutEd.BatchLoadCobol <params>
 
  Required Parameters:
  --------------------
 
    -f file                or    -d directory
 
  Optional Parameters:
  --------------------
 
    -font        font name (leave out for normal text, cp037 for EBCIDIC)
    -s           system name (Defaults to CobolBatchLoad
    -o, -split   split options  none, 01 or redefines
                 Used if the file contains mutliple file formats
    -r           regular expression to check against file name
                 (i.e. ^PZ.* for files starting with PZ
		 see http://docs.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    -c           Cobol Compiler (or binary format) current values:
                    Intel
                    Mainframe
                    Fujitsu
                    Big-Endian_(Old)
                    Open_Cobol_Little_Endian_(Intel)
                    Open_Cobol_bs2000_Little_Endian_(Intel)
                    Open_Cobol_MVS_Little_Endian_(Intel)
                    Open_Cobol_Micro_Focus_(Intel)
                    Open_Cobol_Big_Endian
                    Open_Cobol_bs2000_Big_Endian
                    Open_Cobol_MVS_Big_Endian
                    Open_Cobol_Micro_Focus_Big_E
 

Question

I would like the column heading's to match the Current Record

Answer

Set the record layout to preferred You can set this as the default Edit Options >>>> Properties >>>> Other Options


Appendix E. Reporting

The old re2jasper addon has been enhanced and rereleased as Flat File Reporting. This basically an plugin to iReports report designer to allow the use of RecordEditor and Cobol files to be used in iReports and Jasper Reports. The interface is not very intuitive (I have to work with what iReports gives me) so I suggest following the examples given, but if you wish to produced Reports / Graphs from your Files, have a look at it


Appendix F. Tips

Moving Columns

You can move columns about by clicking on a Column header and dragging the column to another Position. e.g. The following table

Can be changed to the following table by dragging the columns to the desired position

Creating Simple Reports

You can create very basic reports by combining Filtering (see "Filter Screen") with the Save-As / Export Function (see "Save AS / Export").

With the AMS-PO file which consists of

It looks like this:

you can select specific fields of the PO header by entering:

This will produce a filtered view like

To save as a HTML file, select the SaveAs button, then enter the following on the SaveAs Screen:

This will produce the following HTML

Line8 : 10
Vendor
18 : 12
PO
30 : 6
Entry Date
48 : 4
Department
52 : 6
Expected Receipt Date
87 : 2
Order Type
16060286225040909200 050102FT
26228222227040909200 050102FT
36228222243040909200 050102FT
45341294915041013475 041231FT
55341294987041013475 041231FT
65341295139041013475 041231FT
75341303662041110310 041231FT
85341304100041111310 041231FT


Appendix G. HSQLDB Version

Warning The RecordEditor Instillation program will install a HSQLDB server into your Windows start-up directory (so the DB server will start automatically when you Start Windows). It is perfectly safe to remove HSQLDB Database server from the Windows Start up directory. But to use the RecordEditor, you will need to start the server manually.

This version uses the Open Source Database - HSQLDB as its backend Database. To use the system, the Database Server must be started (should happen automatically on Windows version when you start Windows). If the Database is not started you will get an error message like

DataBase Connection error: socket creation error
 

You may find it useful to have a SQL client. If so the connection details are
Driver&Install_Directory\lib\hsqldbmain.jar
URL (Connection String)jdbc:hsqldb:hsql://localhost/recordedit


Appendix H. JDBC Properties file

All the JDBC connection details are held in a property file utils/RecordEdit.Properties" in the 2 JAR's (RecordEdit.jar, LayoutEdit.jar).

The system supports up to 16 Source Databases with numeric index in the property name. i.e. Source.0 holds the JDBC connection string for Database 0 while Source.3 holds the JDBC connection string for Database 3

There is a bat file UpdateProperties.bat that will update the jar with a new properties file. Or to do it manually (requires Java SDK)

jar -uf RecordEdit.jar utils/RecEdit.properties
jar -uf LayoutEdit.jar utils/RecEdit.properties
 

Variables that can be set for a Database connection are

Variable Description
SourceName Name given to the Database in the Combobox
Driver JDBC Driver. This Driver must be in the Class Path.
Source JDBC connection string
User User Id to be used when connecting to the Database.
Password Password to be used when connecting to the Database.
Commit Wether to do a Commit when closing a Database. This only for HSQLDB.
Checkpoint Whether to Checkpoint when closing a Database. This only for HSQLDB.

Other non Database properties are
HelpDirDirectory holding the help files
DefaultFileDirectoryDirectory where the Editor Starts in (if no file specified)
DefaultCobolDirectoryThe Directory where Cobol Copybooks are stored.
VelocityTemplateDirectoryDirectory where Velocity Templates are held.
usePgnIconsIf set to N, the system will use Eclipse style icons instead of Windows style icons.
UserInitilizeClassA user written initialise class. This class will be invoked when the RecordEditor starts.It should have a constructor that does not have any parameters.
spaceAtBottomOfScreenSpace to be left at the bottom of the screen.
spaceAtTopOfScreenSpace to be left at the top of the screen.
spaceAtLeftOfScreenSpace to be left at the left of the screen.
spaceAtRightOfScreenSpace to be left at the Right of the screen.
DateFormatFormat to display Dates. This field is case sensitive. Typical formats might be dd/MM/yyyy for 31/11/2007 or dd.MMM.yyyy for 31.Nov.2007.
SignificantCharInFiles.#Where # is 1 to 3. These 3 variables control the looking up record Layout Names from the file name. The RecordEditor first tries to match on the full_filename followed by full_filename truncated to SignificantCharInFiles.3 characters. It will then try full_filename truncated to SignificantCharInFiles.2characters.
LauchEditorIfMatchControls wether the Editor is launched automatically. A value of
  • 5 or greaterEditor is not launched automatically
  • 4 Editor is launched if there is an exact match on the full file name.
  • 3 Editor is launched if there is an match on the first SignificantCharInFiles.3 characters.
  • 2 Editor is launched if there is an match on the first SignificantCharInFiles.2 characters.
  • 1 Editor is launched if there is an match on the first SignificantCharInFiles.1 characters

## Sample MS Access / ODBC connection
SourceName.0=Record Edit
Source.0=JDBC:ODBC:RecordLayout
Driver.0=sun.jdbc.odbc.JdbcOdbcDriver
 
## Sample HSQLDB
Commit.1=Y
Checkpoint.1=Y
SourceName.1=hsqldb
Source.1=jdbc:hsqldb:hsql://localhost/recordedit
Driver.1=org.hsqldb.jdbcDriver
User.1=sa
 
## My SQL
SourceName.2=My SQL
Source.2=jdbc:mysql://localhost/recordedit
Driver.2=org.gjt.mm.mysql.Driver
 
## Oracle connection via Oracle Fat Client Driver
SourceName.3=Record Edit - Oracle
Source.3=jdbc:oracle:oci8:@ordas
Driver.3=oracle.jdbc.driver.OracleDriver
User.3=targxxxx
Password.3=apassword
 
## Help Directory
HelpDir=File:G:/RecordEdit_Prj/Docs/
 


Appendix I. Changes

Release 0.94.1

Release 0.94

Release 0.92.1

Release 0.92

Release 0.91

Release 0.90

Release 0.89.1 -> 3

Release 0.88

Release 0.86

Release 0.85

Release 0.80.6

Release 0.80.2

On the SaveAs/Export screen there is

Release 0.80.1 Tree (including Xml)

Release 0.69.1

Minor release:

Release 0.67

Minor release:

Release 0.65

Changes in this release are primarily a "Clean-up / Minor Enhansements".

Release 0.62

This release contains new "Tree" views, Combo boxs etc, See Changes version 0.62 for more details.

Release 0.61.2

Cleanup / bug fix, + Enhanced Wizard and XML import functions. See Changes version 0.61b for more details.

Release 0.61

Mainly Look and feel related. See Changes version 0.61 for more details.

Release 0.60

Mainly extra functions

Release 0.56

This version is mainly changes to the user Interface to improve ease use. Major changes are:

RecordEditor to Jasper

The RecordEditor ~ Jasper Interface has been released as a separate download. It requires RecordEditor and iReports be installed. This package:

  1. Illustrates calling RecordEditor routines
  2. Can design and generate reports from Fixed Field Width data files which includes Binary, Cobol and Mainframe/Cobol datafiles.

Release 0.55

This version is primary a refactoring of the code with aims of:

Enhancements:

Other changes

Release 0.53

Changes in this release

Release 0.52.1 (Linux)

This release basically is to support Linux. Mostly it consists of changes to documentation

Release 0.52 (Mainframe)

This change was to support Mainframe Binary files.

Release 0.51

This version was to support Floating point numbers and bug fixes.

Release 0.50 Initial Release  The initial release of the RecordEditor


Appendix J. Linux

The RecordEditor program has always run on Linux / Unix, but originally many of the associated files (eg documentation) did not store files in the correct case (Linux is case sensitive). As of version 0.52.1 this has been corrected.

There is now an installation program

Download RecordEdit_Installer_for_HSQL_<Version>.jar

for Linux / Unix. To run install the RecordEdit on Linux you should:

  1. Run the installation program (i.e. java -jar RecordEdit_HSQL_055.jar) under your normal user id.

  2. The installation should install Icons on your desktop to:

  3. The Installer will create shell scripts in 2 directories I suggest including one of these directories in your path. That way you can edit a file by entering:

    runRecordEdit.sh filename

  4. One difference from the Windows is you must start the DB Server prior to using the RecordEditor.

  5. Start the Edit Properties, take the Screen Position tab and set the Space ot be left at the bottom of the screen to 40. For Gnome users also set the Space ot be left at the top of the screen to around 20.


Appendix K. Window Right Click

In Windows Explorer, the functions available on Right Click menu are defined in the registry (under *\Shell). The Windows Specific installers should setup the RecordEditor on the right click menu. For the Java installer and generic versions, there should be a file

<install directory>\lib\HSQL.reg

Please modify the supplied registry file as need to be and then run it.

Here is what the registry files looks like

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\*\Shell\Record Edit HSQLDB]
@=""
 
[HKEY_CLASSES_ROOT\*\Shell\Record Edit HSQLDB\command]
@="\"C:\\Program Files\\Java\\j2re1.4.1_05\\bin\\\\javaw.exe\" -cp \"C:\\Program Files\\RecordEdit\\HSQLDB\\lib\\RecordEdit.jar;C:\\Program Files\\RecordEdit\\HSQLDB\\lib\\hsqldbmain.jar\" edit.EditRec  \"%1\""

Note: The command is

<Java> -cp <Record Editor> edit.EditRec \"%1\"

Note: Use the standard Windows Notepad Editor to edit the Registry file.


Appendix L. Rexx

Rexx is a scripting language, which I use in preference Windows Bat files (or Unix Shell scripts).

I have converted the simpler Rexx programs to bat files but I have left the original Rexx programs in the system. I currently use the Regina 3.3 interpreter.

Note: Try RexxLA or Search IBM's sites for details on Rexx.


Appendix M. Related Systems / Useful Systems

The follow packages where used in the RecordEditor

All these systems are available on WWW.SourceForge.net.

If you have any comments, issues, problems please please report them: