Previous Topic

Next Topic

Book Contents

Book Index

VTAM logoff

Use the keyboard SysRq (System Request) function or simply switch off the terminal. This will probably free the terminal for other usage, but might not close the application session properly. For example, a TSO session will not be terminated, but is available for a reconnect from another terminal.

KOA supports both methods of session termination. It is recommended that both methods be specified within the script. KOA scripts should terminate the session with an ‘application logoff’ and then use the KOA command LOGOFF to perform a `VTAM logoff’ which releases the terminal for use.

For example, to terminate a CICS session:

Table 19 KOA Sample Script to Terminate a CICS Session

Command

Explanation

SCREENMODE NORECEIVE

Change the screen emulation to NORECEIVE.

TYPE `CESF LOGOFF’

Type CICS command LOGOFF at the keyboard.

ENTER

Send the command to CICS.

LOGOFF

Issue the KOA LOGOFF command to disconnect the session.

When a session is terminated in an orderly way, the application usually sends an "end-of-session" message (such as when TSO sends an IKJ56470I message) and then releases the terminal. Using the default method of information exchange (implied send/receive), KOA receives that message, and supplies a return code to the script that indicates that the session is no longer active. The script can either handle that return code while it is terminating the session, or ignore (not receive) the last message from the application.

For example, terminate a TSO session:

Table 20 KOA Sample Script to Terminate a TSO Session

Command

Explanation

TYPE `LOGOFF’

Type the TSO LOGOFF command at the keyboard.

ENTER

Send the command to TSO.

IFVAR %VTAMERR NE `SESS-NOT-ACT’ GOTO CHKERR

Verify that the TSO session is not active. If it is still active, branch to label CHKERR (not included in this sample) for error processing. If the TSO session is not active, proceed to the next script command.

LOGOFF

Issue the KOA LOGOFF command to disconnect the session.

Parent Topic

Terminating a Session