IMS message formats for outbound messages
When you send messages from Liberty to IMS by using OTMA, the
zosLocalAdapters feature must convert the message from an IMS format to OTMA C/I
format. To do this conversion, Liberty must know whether the request and response message segments
are in LLZZ or LLLLZZ format.
An LLZZ format message segment starts with a 2-byte field that contains the
length of the segment, followed by a 2-byte reserved field. The remaining portion of the segment is
used by the actual message. Most IMS segments use this format.
An LLLLZZ format message segment starts with a 4-byte field that contains the
length of the segment, followed by a 2-byte reserved field. The remaining portion of the segment is
used by the actual message. The LLLLZZ format is used by some PL/I programs.
The segment format for the request and response can be specified on the connection factory
definition in server.xml, by setting the OTMARequestLLZZ and
OTMAResponseLLZZ properties. The segment format can also be specified, or can be
over-ridden, by using methods on the ConnectionSpecImpl class when you obtain a
connection from the connection factory. The generated Javadoc for
com.ibm.websphere.ola.ConnectionSpecImpl has more information about setting the
LLZZ fields at the connection level.
When you send multi-segment messages to IMS, the first message segment must contain the 8-byte
IMS transaction identifier of the target IMS transaction. This transaction identifier follows the
LLZZ or LLLLZZ prefix. Subsequent segments must not contain the
transaction identifier. Single segment messages must be constructed in the same way as the first
segment of a multi-segment message. A multi-segment message might look like this:
2 bytes LL 20
2 bytes ZZ 00
8 bytes transaction ID 'MYTRAN01'
8 bytes data 'DATA0000'
2 bytes LL 12
2 bytes ZZ 00
8 bytes data 'DATA0001'
2 bytes LL 12
2 bytes ZZ 00
8 bytes data 'DATA0002'
All message segments must be concatenated to a single byte array, and passed to IMS by using an
IndexedRecord. The class com.ibm.websphere.ola.IndexedRecordImpl
is provided for this purpose. The single byte array must be added to the
IndexedRecord, and passed to WOLA when you drive
Interaction.execute. When the interaction returns the response, it returns an
IndexedRecord, which contains all of the response segments that are concatenated
together in a single byte array. The format of the segments is either LLZZ or
LLLLZZ, depending on the value of the OTMAResponseLLZZ
property.