Mapping COBOL data items to boolean and date types

When creating 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

The boolean and date types do not exist in COBOL. If you want to use these 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 during the XOM generation process, when the XOM generation wizard displays the Configure COBOL XOM Mapping page. This page shows the default COBOL to Java type mappings.

Important:

Boolean and date formats do not support signed numbers.

Procedure

To configure the default Java type mapping:

  1. On the Configure COBOL XOM Mapping page, right-click the row that contains the type you want to configure and then click Add Converter.
  2. On the Configure Converter Settings page, select which converter you want to use:
    • String to date Converter

    • String to boolean Converter

  3. Type the value you want to use:
    • For boolean, you can define a True value and False value using any string or number.

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

  4. Click OK.

    On the Configure COBOL XOM Mapping page, the Converter applied column displays Yes, indicating that the default mapping has been changed.

  5. Click Finish to close the Configure COBOL XOM Mapping page, and then click OK to generate the XOM.

    For information about generating a XOM from a COBOL copybook, see Generating a COBOL XOM.