Session termination
Terminating a session releases the terminal from its current logical connection to IMS (the VTAM® application program). Terminating a session also makes the terminal available for sessions with other VTAM application programs, or you can terminate communications altogether.
Sessions can be terminated by the IMS MTO, the VTAM network operator, or the user at the terminal. There are two types of session termination:
- Orderly termination
- The terminal is allowed to complete normal processing before the session is terminated.
- Immediate termination
- Forces the terminal to terminate the session unconditionally.
Because these two session termination methods have different consequences, you must develop specific procedures for different situations.
Orderly termination
To initiate an orderly termination of the network, use the IMS /CHECKPOINT [FREEZE | PURGE | DUMPQ] QUIESCE command. When you specify the QUIESCE keyword, IMS sends a VTAM shutdown command to all terminals and waits until they all complete normal processing.
After all terminals indicate that shutdown is complete, IMS issues VTAM CLSDST macro instruction to cause VTAM to send the UNBIND command to all terminals. This command releases the terminals from their sessions with IMS, and prohibits additional data transmission.
During an orderly termination, the IMS MTO can terminate the network unconditionally, rather than wait for the orderly termination to complete, by initiating an immediate termination.
Immediate termination
To initiate an immediate termination of the network, use the IMS /CHECKPOINT FREEZE | PURGE | DUMPQ command. When you enter this command, without the QUIESCE keyword, IMS issues the VTAM CLSDST macro instruction to cause VTAM to send the UNBIND command to all terminals. This command releases the terminals from their sessions with IMS, and prohibits additional data transmission.
You can use the /CLSDST or /STOP commands to terminate stations or portions of a network selectively. These commands cause IMS to issue the VTAM CLSDST macro instruction for the specified stations. The /STOP command also prevents additional sessions from being established until you issue a /START command for the terminal.
The VTAM network operator can use the VARY command to terminate a session immediately. It is sometimes necessary for the VTAM network operator to use this command to terminate sessions that have an error preventing an I/O operation from completing.
The terminal user can use VTAM session control commands to terminate a session with IMS. For normal processing, when the user decides to terminate a session with IMS, the terminal should send the VTAM request-shutdown command. IMS completes any input or output currently in progress for that terminal and then issues the VTAM CLSDST macro instruction.
If the terminal detects an error condition from which it cannot recover, it can send the VTAM terminate-session command. VTAM releases the terminal from the session and notifies IMS.