Making the connection unavailable
The SET CONNECTION RELEASED command quiesces transactions using the connection and releases the connection.
It cannot, on its own, prevent reacquisition of the connection from the partner system. To prevent your partner from reacquiring the connection, you must execute a sequence of commands. The choice of command sequence determines the status the connection adopts and how it responds to further commands from either partner.
If the number of available sessions for every modegroup of a connection is reduced to zero (by, for example, a CEMT SET MODENAME AVAILABLE(0) command), ALLOCATE requests are rejected. Transaction routing and function shipping requests are also rejected. The connection is effectively unavailable. However, because the remote system can renegotiate the availability of sessions and cause those sessions to be bound, you cannot be sure that this state will be held.
To prevent your partner from acquiring sessions that you have made unavailable, use the CEMT SET MODENAME CLOSED command. This reduces the number of available user sessions in the modegroup to zero and also locks the modegroup. Even if your partner now issues SET CONNECTION RELEASED followed by SET CONNECTION ACQUIRED, no sessions in the locked modegroup become bound until you specify an AVAILABLE value greater than zero.
If you lock all the modegroups, you make the connection unavailable, because the remote system can neither bind sessions nor do anything to change the state.
Having closed all the modegroups for a connection, you can go a step further by issuing CEMT SET CONNECTION RELEASED. This unbinds the SNASVCMG (LU services manager) sessions. An inquiry on the CONNECTION returns INSERVICE RELEASED (or INSERVICE FREEING if the release process is not complete).
If you now enter SET CONNECTION ACQUIRED, you free all locked modegroups and the connection is fully established. If, instead, your partner issues the same command, only the SNASVCMG sessions are bound.
You can prevent your partner from binding the SNASVCMG sessions by invoking CEMT SET CONNECTION OUTSERVICE, which is ignored unless the connection is already in the RELEASED state.
CEMT SET MODENAME(*) CONNECTION(....) CLOSED
[The CONNECTION option is significant only if the MODENAME applies to more
than one connection.]
INQ MODENAME(*) CONNECTION(....)
[Repeat this command until the AVAILABLE count for all non-SNAVCMG
modegroups becomes zero.]
SET CONNECTION(....) RELEASED INQ CONNECTION(....)
[Repeat this command until the RELEASED status is displayed.]
SET CONNECTION(....) OUTSERVICE