Conversational transactions
Conversational transaction processing allows you to retain message continuity from a given terminal, even when the program that processes the conversation is not retained in storage throughout that conversation.
When the transaction is defined as conversational, the application program can use a scratchpad area (SPA) in order to interrelate messages from a given terminal.
The scratch pad area (SPA) is a work area used in conversational processing in order to retain information from an application program across executions of the program. A unique SPA is created for each conversation.
Contents of the SPA
Typical contents of the SPA are data items entered at the terminal and data that is retrieved from databases to be saved between iterations of the conversation. To simplify operator procedure and application design, database updates are retained in the SPA until the last iteration of the conversation.
Any subsequent data entry from a terminal that is already operating in conversational mode causes a message processing program (MPP) to receive both the contents of the SPA and the input terminal data. Each input message is considered an individual unit of work. Each interaction can be with a different program, although the same program is typically used.
Message processing for conversational transactions
- IMS removes the transaction code and places it at the beginning of a message segment. The message segment is equal in length to the SPA that was defined for this transaction during system definition. This is the first segment of the input message that is made available to the program. The second through the nth segments from the terminal, minus the transaction code, become the remainder of the message that is presented to the application program.
- When the conversational program has prepared its reply, it inserts the SPA to IMS. The program then inserts the actual text of the reply as segments of an output message.
- IMS saves the SPA and routes the message to the input LTERM.
- If the SPA insert specified that another program is to continue the same conversation, the total reply (including the SPA) is retained on the message queue as input to the next program. This program then receives the message in a similar form.
- A conversational program must be scheduled for each input exchange. The other processing continues while the operator at the input terminal examines the reply and prepares new input messages.
- To terminate a conversation, the program places blanks in the transaction code field of the SPA, and inserts the SPA to IMS.
- The conversation can also be terminated if the transaction code in the SPA is replaced by any nonconversational program's transaction code, and the SPA is inserted to IMS. After the next terminal input, IMS routes that message to the other program's queue in the normal way.
ETO conversations
ETO conversations maintain associations with users, rather than with terminals. The conversation is associated with the terminal only while the user is signed on. The conversation can be restarted on any other ETO terminal.
Program switches for conversational programs
A conversational program can use a deferred program switch or an immediate program switch.
- During a deferred program switch, the program responds to the originating terminal but causes the next input from the terminal to go to another conversational program.
- During an immediate program switch, the program passes the SPA (and, optionally, a message) to another conversational program without responding to the originating terminal. In this case, it is the next program's responsibility to respond to the originating terminal.