Skip to content

XML to COBOL Mapping in IBM Integration Bus

by on June 18, 2015

We have made a new video of our XML to COBOL examples that we have done in WebSphere Message Broker v7 and V8.   If you follow this video example end to end you will be able to get a XML to COBOL integration solution working quickly.   We are also including the XML Schema and COBOL copybooks at the end of this blog post.



Thank you for checking out our blog post and video.   Please let us know if you have any questions or feedback.

Thank you,

TransformaTech, Inc

Follow us on Twitter at:  TransformaTech Twitter

XML TO COBOL Artifacts:

1. XML Schema

<?xml version=”1.0″ encoding=”UTF-8″?><xsd:schema xmlns=”” xmlns:xsd=””&gt;
<xsd:element name=”SampleInput”>
<xsd:element ref=”Name”/>
<xsd:element ref=”Address”/>
<xsd:element ref=”Contact”/>
<xsd:element name=”Name”>
<xsd:element ref=”FirstName”/>
<xsd:element ref=”LastName”/>
<xsd:element ref=”MiddleInitial”/>
<xsd:element name=”Address”>
<xsd:element ref=”Street”/>
<xsd:element ref=”City”/>
<xsd:element ref=”State”/>
<xsd:element ref=”ZipCode”/>
<xsd:element name=”Contact”>
<xsd:element ref=”Phone”/>
<xsd:element ref=”Email”/>
<xsd:element name=”FirstName” type=”xsd:string”/>
<xsd:element name=”LastName” type=”xsd:string”/>
<xsd:element name=”MiddleInitial” type=”xsd:string”/>
<xsd:element name=”Street” type=”xsd:string”/>
<xsd:element name=”City” type=”xsd:string”/>
<xsd:element name=”State” type=”xsd:string”/>
<xsd:element name=”ZipCode” type=”xsd:string”/>
<xsd:element name=”Phone” type=”xsd:string”/>
<xsd:element name=”Email” type=”xsd:string”/>

2.  XML COBOL Copybook (IMPORTANT NOTE:  spacing and formatting is important when using copybook inside IIB for import.   It is important when you copy and paste these into a file that there are no tabs and everything is positioned correct)

03 NAME.
05 FIRSTNAME                                    PIC X(20).
05 LASTNAME                                     PIC X(25).
05 MIDDLEINITIAL                                PIC X(1).
05 MYADDRESS1                                   PIC X(40).
05 CITY                                         PIC X(25).
05 STATE                                        PIC X(2).
05 ZIP                                          PIC X(5).
05 PHONE                                        PIC X(10).
05 EMAIL                                        PIC X(50).
03  FILLER                           PIC X(1000) VALUE SPACES.

3.  Sample Input Message

<Street>1 E Uwchlan Ave</Street>


From → Integration

  1. Brian permalink

    Is there a way to do the opposite, taking the cobol copybook and converting it to XML?

    • Hi Brian – Yes, this can be done in reverse the exact same way. Many of our client implementations of this involve the following Scenario:

      1. Web Application (.NET, J2EE, etc) sends XML request to IIB/WMB
      2. IIB/WMB transforms message to fixed length message and optionally adds IMS/CICS header for IMS/CICS transactions and sends to queue on mainframe
      3. IMS/CICS Bridge (or COBOL program) receives message from this queue performs logic and sends fixed length message to a reply queue to send to IIB/WMB
      4. IIB/WMB takes this response, transforms it back to XML and sends back to Web Application.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: