Understanding CICS Events

Topics:

A CICS Event is the processing defined on a particular message received from CICS. A CICS program sends a message to communicate that a specific event occurs, for example, when an inventory level crosses a threshold. In the most common use case, an EBCDIC COBOL Copybook formatted record is received, converted to an XML document, and delivered to a queue or program.

All processing details for a message are configured under a channel, which include:

A CICS Event can be configured as REQUEST only, in which the Event consumes a message, or REQUEST/RESPONSE, in which the Event consumes a message and returns a reply message.

The following diagrams and sequences illustrate REQUEST and REQUEST/RESPONSE scenarios:

REQUEST

The following sequence outlines how request messages are processed.

  1. A message is created by a CICS user program.
  2. The message is sent via TCP to a channel (TCP port).
  3. The channel receives the message.
  4. If the channel is configured to work with Copybook formatted messages, it converts the message to XML.
  5. The channel routes the message to one or more destination ports for further processing, for example, to a JMS queue.

REQUEST/RESPONSE

The following sequence outlines how request/response messages are processed.

  1. A message is created by a CICS user program.
  2. The message is sent via TCP to a channel (TCP port).
  3. The channel receives the message.
  4. If the channel is configured to work with Copybook formatted messages, it converts the message to XML.
  5. The channel routes a message to a destination port for further processing, for example, an HTTP request.
  6. The port takes an XML document as input and returns an XML document as output to the channel. For channels configured with COBOL Copybook formatted messages, these documents conform to the XML schemas generated from these Copybooks using iWay Explorer.
  7. If the channel is configured to work with Copybook formatted messages, it converts the XML into Copybook format.
  8. The channel returns the reply message to the CICS program.

Message Format

A message can be a Copybook formatted record or an XML document.

Copybook formatted messages have the following properties:

  • The request message must be prefixed by a 4-byte message length.
  • The Reply messages (if returned) will be prefixed by 4-byte message length.
  • Messages correspond to Copybooks configured as a PreParser and PreEmitter on the channel.

XML formatted messages have the following properties:

  • Request and Reply messages (when returned) are XML documents, conforming to the input and output document types of the backend process.

The following sample event programs are included with the product:

  • iwayevt0 - COBOL, copybook described data, request only
  • iwayevt1 - C, XML, request/response
  • iwayevt2 - COBOL, copybook described data, request/response

For more information, see Sample Programs.

Supported Environments

CICS Event handling is supported under Servlet iBSP.

iWay Service Manager (iSM) does not support CICS Events. However, similar event handling capabilities can be achieved by configuring a CICS PreParser and PreEmitter. For more information, see the iWay Service Manager User’s Guide.