About the COBOL sample
This sample provides two scenarios to demonstrate how you can model binary messages by using WebSphere Message Broker.
The first scenario uses two DFDL schema files, OrderList.xsd and PurchaseData.xsd. Both of these DFDL schema files were created by using the COBOL importer for DFDL.
This scenario demonstrates modifying the contents of a modeled message, then serialising to a message that has a different model.
The second scenario uses the DFDL schema file, CustomerAddress. The COBOL copybook used to create this schema uses 88-level variables.
When using 88-level variables in the DFDL COBOL importer wizard, the result in the DFDL schema file will be an enumeration of the values in the 88-level variable.
The DFDL schema files that are included in this sample accurately model example messages that include:
- OCCURS
Within the COBOL copybook "OrderList", the level 10 structure "Item" occurs 10 times
- OCCURS DEPENDING ON
Within the COBOL copybook "OrderList", the level 10 structure "Invoice" occurs 1 through 50 times, depending on the level 5 structure "InvoiceCount".
The level 20 structure "Item" occurs between 1 and 50 times, depending on the level 5 structure "ItemCount".
- REDEFINES
- Within the COBOL copybook "OrderList", the level 5 structure "PointOfSale2" redefines the level 5 structure "PointOfSale1".
- The COBOL program was designed to use the value of the level 5 structure "PointOfSaleType" to determine whether the redefine should be applied. When the COBOL copybook "OrderList" is used to construct a DFDL message model in WebSphere Message Broker, a DFDL discriminator annotation is added to the DFDL schema file.
The DFDL discriminator is used by the DFDL parser to build the correct logical model.
- Within the COBOL copybook "CustomerAddress", the level 5 structure "AddressParts" redefines the level 5 element "AddressString".
This redefine enables the COBOL program to move the address data as a single data element, "AddressString", or to work with the data as separate elements, contained in "AddressParts".
When the COBOL copybook "CustomerAddress" is used to construct a DFDL message model in WebSphere Message Broker, the redefine that is included in the level 5 structure "AddressParts" is made the default, so that the logical model includes the address data as separate elements.
- 88-Level variables
Within the COBOL copybook "CustomerAddress", the level 7 element "Country" has 4 possible 88-level values.
For a detailed explanation of how to run each scenario, see
Running the COBOL sample.
For an explanation of how to re-create these schemas, see Building the COBOL sample.
Back to sample home