Creating dynamic domains for COBOL projects in an Excel file

You create domains by using data stored in an Excel spreadsheet. You can set up an Excel file with the domain values you want to use, using a separate sheet for each domain.

About this task

You create dynamic domains for a COBOL project by using values extracted from an Excel spreadsheet. You set up an Excel file with the domain values you want to use, using a separate sheet for each domain. You then store the Excel file in the resources folder of your rule project.

Important:

If you want to change domain values, you must update the Excel file. You cannot edit the BOM members from within the BOM.

Procedure

  1. Define the required domain values in an Excel spreadsheet.

    As a minimum, each Excel sheet you use must include the following columns:

    • Value

    • Label

    • BOM to XOM mapping

    • COBOL values

    For example, if you use the following COBOL copybook and define a domain named country that has a set of values such as {China, France, USA}, you might define the following columns and values for Country:

    05 country PIC X(2).
    05 color PIC 9(12).
    Value Label BOM to XOM mapping COBOL values
    CHINA CHINA Color.createCountry(“CN”) CN
    FRANCE FRANCE Color.createCountry(“FR”) FR
    USA USA Color.createCountry(“US”) US

    Make sure that the Excel file has the correct structure.

  2. Save the file to the resources folder in your rule project.
  3. In the BOM editor, open the BOM class for which you want to create a domain.
  4. In the Domain section, click Create a domain.
  5. Select Dynamic Domains > Excel, and then click Next.
  6. In the Excel File field, select the Excel file from the resources folder in your rule project.
  7. In the Sheet field, select the worksheet that contains the values for the required domain.
  8. Select the Table with header check-box so that the drop-down lists display the names of the columns instead of the default column letters.
  9. In the Value column, BOM to XOM column, and Label column fields, select the corresponding columns in your Excel file.
  10. Click Next and then click Add, to add a custom property
  11. For the name of your custom property, enter: cobol_domain_value.
  12. In the Excel file, select the column that contains the COBOL values for the domain.
  13. Save your work.

Results

The BOM editor displays the domain values, and you can now use them when writing rules.