Previous Topic

Next Topic

Book Contents

Book Index

Unexpected Messages

During a session between a VTAM application and a terminal, most received messages are expected. For example, a user knows that pressing PF01 displays a Help screen. However, there are situations where unexpected messages (unsolicited messages) are displayed on the terminal.

An example of an unexpected message is a message sent by the operator to a TSO user. When the message is received, the user simply presses the Enter key and continues working. Similarly, a KOA script can also handle unexpected messages, and can continue processing based on the user’s specifications.

To handle unexpected messages, KOA is designed so that each time the script sends a message to the application, it first checks if the VTAM application has sent a message to KOA. A message to KOA is not expected at this time (because the script was about to send its own message). The unexpected message is handled using one of the methods listed below:

If the current SCREENMODE is IGNUNSOL (default), KOA ignores the unexpected message and sends its own message to the application.

If the current SCREENMODE is GETUNSOL, KOA does not send its own message, and returns to the script with an appropriate return code. Based on the return code, the script determines whether to accept (with command GETSCREEN), or to ignore the unexpected message (by sending the same message as before).

The sample script below illustrates the handling of unexpected messages during a TSO session:

Table 21 KOA Sample Script to Handle Unexpected Messages During a TSO Session

Command

Explanation

LABEL SENDISPF

Specify label SENDISPF for script flow branching purposes.

TYPE `ISPF’

Type the TSO command ISPF at the keyboard.

ENTER

Send the command.

IFVAR %VTAMERR NE `UNSOLMSG’ GOTO CONTINUE

Determine if any unexpected messages were received. If none were received, proceed to label CONTINUE. If unexpected messages were received, proceed to the next script command.

GETSCREEN

Receive (accept) the unexpected message.

CLEAR

Clear the screen.

GOTO SENDISPF

Branch back to label SENDISPF – try to send command ISPF to TSO again.

You may need to implement a counter or other mechanism to prevent an infinite loop if the ISPF screen is never displayed.

LABEL CONTINUE

Specify label CONTINUE for script flow branching purposes.

Continue script processing.

Parent Topic

KOA Implementation Considerations