Mapping COBOL data items to boolean and date types

The boolean and date types do not exist in COBOL. When you generate a XOM from a COBOL copybook, you can use a predefined type converter to change the default mapping of COBOL data items to Java™ boolean and date types.

About this task

If you want to use Java boolean and date types in your XOM, you can use the predefined boolean and date type converters to convert COBOL alphanumeric (PIC X) or unsigned numeric (PIC 9) data items to the Java boolean or date type.

You access the predefined type converters when the XOM generation wizard displays the Configure COBOL XOM Mapping page. The page shows the default COBOL to Java type mappings.

Procedure

  1. On the Configure COBOL XOM Mapping page, click a data item in the COBOL Structure pane that you want to remap.
  2. In the XOM Mapping pane, right-click a row and select Add Converter.
  3. On the Configure Converter Settings page, select a converter that you want to use.
  4. Type the value that you want to use:
    • To convert to boolean, define True value and False value by using any string or number.

    • To convert to date, in Date format, enter the format in which the date is stored within the COBOL string, such as yyyyMMdd or dd/mm/yy.

    Important: Boolean and date formats do not support signed numbers.
  5. Click OK.

    On the Configure COBOL XOM Mapping page, the Converter column displays Applied, indicating that the default mapping is changed.

  6. Click Finish when you are ready to generate the XOM.