Table mapping between COBOL and Java

Fixed length tables map to a Java™ array. The default mapping for variable length tables is to a Java list.

When you generate a COBOL XOM from a COBOL copybook, any fixed length tables in the COBOL copybook map to a Java array. Fixed length tables are fully supported and you can use them with no restrictions.

If the copybook contains ODO tables (Occurs Depending On), these variable length tables map to a Java List.

When generating a XOM, the copybook must not contain ODO tables that share the same depending on item. If it does, you get an error. You can use this structure in COBOL because the two tables retain a relationship. However, when you convert the table to the Java List type, the tables lose this relationship and so the item values in each Java list can become misaligned.

For example, in the following copybook tables T1 and T2 share the same Counts value:

01 tables.
    03 Counts PIC 9.
    03 T1 PIC X OCCURS 5 TIMES depending on Counts.
    03 T2 PIC X OCCURS 5 TIMES depending on Counts.

The following example shows the mapping for a fixed and a variable length table:

COBOL copybook Java mapping during XOM generation
01 tables.
    03 Counts PIC 9.
    03 AElement PIC 9 OCCURS 5 TIMES.
    03 BElement PIC 9 OCCURS 5 TIMES
       depending on Counts.
Public class Tables {
   private short[] aElement;
   private List<String> bElement;
   ….

   List<String> getbElement();
   setBElement(List<String> BElement);
   ….

}