TM and MSC Message Routing and Control user exit routine overview

Message routing is automatic, according to the defined scheme, unless you use the TM and MSC Message Routing and Control user exit routine (DFSMSCE0), which provides routing options and control of messages.

The DFSMSCE0 exit routine provides a single parameter list and the ability to append optional user prefixes to messages for customizing message routing and security.

The DFSMSCE0 exit routine also provides an IMSplex affinity routing option for IMSplexes with shared queues. Affinity routing establishes an affinity between a transaction instance and a destination IMS system specified by the exit routine. When the DFSMSCE0 exit routine assigns an affinity to a transaction and the transaction is inserted to the shared queue, only the destination IMS system is notified.

Note: Using this exit routine does not require Multiple Systems Coupling (MSC), though most of its options work only when MSC is enabled.
This routing exit routine is called before the message destination is final. The entry points of the exit routine are:
  • Terminal routing (TR): Receives control when a message is received from a terminal.
    • VTAM® messages (TRVTAM)
    • APPC messages (TRAPPC)
    • OTMA messages (TROTMA)
  • Link receive (LR): Receives control when a message is received on a MSC link.
    • Local transaction messages (LRTRAN)
    • Local LTERM messages (LRLTERM)
    • Local direct routing messages (LRDIR)
    • Intermediate messages (LRINT)
  • Program routing (PR): Receives control when the application program issues a CHNG or ISRT call to insert a message.
    • Application program CHNG call (PRCHNG)
    • Application program INST call (PRINST)

The TM and MSC Message Routing and Control User Exit routine is loaded during IMS initialization, provided it exists in the JOBLIB, STEPLIB, or LINKLIST library that is concatenated in front of IMS.SDFSRESL. No system definition or startup parameter modules are needed to invoke this exit routine.

You can append optional user-defined prefixes to messages. Message prefixes can be used, for example, to customize message security, user accounting, and statistics requirements, and to increase routing control by allowing communications among exit routines. This user message prefix segment can be added to the message and updated as the message is routed through the MSC/TM network as each exit routine entry point is called. These other exit routines can read or update the prefix segment. The user prefix segment can be used offline. The user prefix size is limited to 512 bytes, and the total message prefix size is limited to the large message queue LRECL.

The TM and MSC Message Routing and Control User Exit routine uses a common parameter list interface (DFSMSCEP) for all of the entry points. DSECTS are provided to reference all parameter fields. You can select the entry points at which the exit routine should take control by changing and reassembling pointers in the DFSMCCSV macro in the front of the user exit module. IMS calls the exit routine if the entry point exists.

Recommendation: Provide a DSECT DFSMSCEP macro for common reference to the parameter fields to make it easier in the future to pass to the exit routines additional data, such as performance or path availability data for use in making routing decisions. Data might include SIO rates, response times, or queue counts.

Terminal routing

The terminal routing entry points of the TM and MSC Message Routing and Control User Exit routine exist in the input system. The exit routine is called when a message is received from a terminal. The exit routine can inspect the specified destination (LTERM or transaction code) and, if specified, reject it or change it to any local or remote destination. If the exit routine does not change the destination, the originally specified destination is used for routing. The exit routine can also override a local LTERM or transaction to route a message to a remote IMS instead.

IMS does not call the exit routine for commands or from a terminal that is continuing a conversation.

In a configuration using horizontal partitioning, the exit routine can be used to evaluate all input messages and route them to the appropriate processing system based on information in the first segment of the input message. If transactions and links are appropriately defined, the exit routine can also be used to set a common destination for a set of input messages. On arriving at the destination system, the messages are processed according to their individual transaction codes.

Link receive

The Link Receive entry points of the TM and MSC Message Routing and Control User exit routine (DFSMSCE0) can change the transaction code or LTERM name of a message when IMS receives the message from an MSC link. DFSMSCE0 can request that the message be processed locally in the current IMS system or it can reroute the message to a different remote IMS system. DFSMSCE0 can inspect the transaction code or the LTERM name that is used as the destination and, if specified, reject it or change it to another destination with the same attributes. The exit routine can also examine the first segment of the message to determine what the new transaction code should be. If the exit routine does not change the transaction code, the destination remains the location that is specified by the original transaction code. DFSMSCE0 can also determine what security to use, if any, on a message by message basis.

Program routing

By using the program routing points of the TM and MSC Message Routing and Control User exit routine (DFSMSCE0), you can control the routing of a message when an application program issues a CHNG or ISRT call. With these entry points, you can change the destination of the message or request to reject a message. The DFSMSCE0 exit routine can also request that the message be processed locally in the current IMS system or it can reroute the message to a different remote IMS system.

You can use the exit routine to avoid defining unique names for remote LTERMs and transactions. With the exit routine, you can have the same name for terminals throughout your MSC network. You can use this exit routine to execute the DL/I CHNG or ISRT call for the application program, and to change the destination from local to remote.