Importing from COBOL copybooks

Before you start:

To complete this task, you must have completed the following tasks:

Also, before you begin this task, you should note the points listed below:

If you previously used the WebSphere MQ Integrator Version 2.1 COBOL importer to create a message model, you may find that the WebSphere Business Integration Message Broker Version 5.0 importer does not produce exactly the same results. In particular, the Version 2.1 COBOL importer did not support as many COBOL constructs as Version 5.0, and the naming convention for Version 2.1 compound types is not the same as the naming convention for Version 5.0 complex types and groups. In a very few cases, the naming convention for Version 2.1 elements is not the same as the naming convention for Version 5.0 elements. If you created message flow ESQL in Version 2.1 to manipulate your COBOL-derived message model, and you have imported that ESQL into Version 5.0 using the mqsimigratemsgflows command, and you are now recreating your message model using the Version 5.0 COBOL importer, you are strongly recommended to review your ESQL for correctness.

The steps below cover creating a completely new message definition file and overwriting the contents of an existing file.

To create a message definition file from a COBOL data structure:

  1. Switch to the Broker Application Development perspective.
  2. Open the New Message Definition File wizard by clicking File > New > Message Definition File from the workbench menu.
  3. In the displayed list of options, click COBOL file then click Next.
  4. In the displayed list of workbench files, click the COBOL file that you want to import then click Next to display a list of message sets. The file must already be in the workbench for it to appear in the list.
  5. Under Message sets, click the target message set for the message definition file that you are creating. The Message definition file name field is automatically filled in with a default file name, based on the name of the file that you are importing. If required, you can change the displayed default file name to a new name of your choice.
  6. If you want to replace the contents of an existing message definition file:
    1. Type the name of the existing file in the Message definition file name field.
    2. Select the Overwrite the existing file contents without warning check box. The existing file is overwritten without a warning being displayed.
  7. Click Next.
  8. Under Source structures, select the source structures that you want to import then add your selections to Imported structures. Use the >, <, >> and << buttons to select individual or all structures and add them to or delete them from Imported structures.
  9. Under Imported structures, select those data structures that you want to be messages in the message definition file. Either click Select All or click the data structures individually.
  10. Optional: Type a name prefix to be added to all the imported global complex types and groups created during the import. Adding a prefix helps to avoid the possible duplication of names.
  11. Optional: If you do not want to add any further information at this point, click Finish. Your new message definition file is created immediately.
  12. If you want to include further import options, click Next.
  13. On the Import options page, specify the physical properties of the new message definition by selecting the appropriate import options.
  14. Optional: If you want to create default values from the initial values, select the Create default values from INITIAL VALUES check box.
  15. Optional: If you want to create minimum inclusive facets, maximum inclusive facets and enumeration facets from the imported COBOL Level 88 values on the simple type associated with the Schema xsd:element, select the Create facets from level 88 value clauses where possible check box. This adds a Value Constraints node under Logical properties in the Properties Hierarchy and the values that you specify are subsequently used for validation during runtime.
    Note: In cases where a simple type has both minimum and maximum inclusive facets set as well as enumeration facets, the enumeration facets are used in preference to the minimum and maximum inclusive facets.
  16. Click Finish. The message definition file is created from the COBOL file and is opened in the Message Definition editor so that you can check the imported information and make any required changes.

Related concepts
Ways to create message definitions
Import from other model representations to create message definitions

Related tasks
Working with a message set project

Related reference
Import formats
Importing from COBOL: supported features
Physical properties for message model objects
Message model object properties