To other programs and terminals

When you want to send an output message to a terminal other than, or in addition to, the terminal that sent the input message, you use an alternate PCB. You can set the alternate PCB for a specific logical terminal when the program's PSB is generated, or you can define the alternate PCB as being modifiable. A program can change the destination of a modifiable alternate PCB while the program is running, so you can send output messages to several alternate destinations.

The application program might need to respond to the originating terminal before the person at the originating terminal can send any more messages. This might occur when a terminal is in response mode or in conversational mode:

In these processing modes, the program must respond to the originating terminal. But sometimes the originating terminal is a physical terminal that is made up of two components—for example, a printer and a display. If the physical terminal is made up of two components, each component has a different logical terminal name. To send an output message to the printer part of the terminal, the program must use a different logical terminal name than the one associated with the input message; it must send the output message to an alternate destination. A special kind of alternate PCB is available to programs in these situations; it is called an alternate response PCB.

Definition: An alternate response PCB lets you send messages when exclusive, response, or conversational mode is in effect. See the next topic for more information.

Alternate response PCB

The destination of an alternate response PCB must be a logical terminal—you cannot use an alternate response PCB to represent another application program. When you use an alternate response PCB during response mode or conversational mode, the logical terminal represented by the alternate response PCB must represent the same physical terminal as the originating logical terminal.

In these processing modes, after receiving the message, the application program must respond by issuing an ISRT call to one of the following:

  • The I/O PCB.
  • An alternate response PCB.
  • An alternate PCB whose destination is another application program, that is, a program-to-program switch.
  • An alternate PCB whose destination is an ISC link. This is allowed only for front-end switch messages.

    Related reading: For more information on front-end switch messages, see IMS Version 15.4 Exit Routines.

If one of these criteria is not met, message DFS2082I is sent to the terminal.

Express PCB

Consider specifying an alternate PCB as an express PCB. The express designation relates to whether a message that the application program inserted is actually transmitted to the destination if the program abnormally terminates or issues a ROLL, ROLB, or ROLS call. For all PCBs, when a program abnormally terminates or issues a ROLL, ROLB, or ROLS call, messages that were inserted but not made available for transmission are cancelled while messages that were made available for transmission are never cancelled.

Definition: An express PCB is an alternate response PCB that allows your program to transmit the message to the destination terminal earlier than when you use a nonexpress PCB.

For a nonexpress PCB, the message is not made available for transmission to its destination until the program reaches a commit point. The commit point occurs when the program terminates, issues a CHKP call, or requests the next input message and when the transaction has been defined with MODE=SNGL.

For an express PCB, when IMS has the complete message, it makes the message available for transmission to the destination. In addition to occurring at a commit point, it also occurs when the application program issues a PURG call using that PCB or when it requests the next input message.

You should provide the answers to the following questions to the data communications administrator to help in meeting your application's message processing requirements:

  • Will the program be required to respond to the terminal before the terminal can enter another message?
  • Will the program be responding only to the terminal that sends input messages?
  • If the program needs to send messages to other terminals or programs as well, is there only one alternate destination?
  • What are the other terminals to which the program must send output messages?
  • Should the program be able to send an output message before it terminates abnormally?