DISCARD CONNECTION

Remove a CONNECTION definition.

DISCARD CONNECTION

Read syntax diagramSkip visual syntax diagramDISCARD CONNECTION( data-value)

Conditions: INVREQ, NOTAUTH, SYSIDERR

Description

The DISCARD CONNECTION command removes a CONNECTION definition from the local CICS system. When a connection is removed, all of the associated sessions also are removed.

For deletion to be successful:
  • The connection can have no active sessions if it is remote (that is, has a REMOTESYSTEM value other than the name of the local region), and must be in OUTSERVICE status if it is not remote.
  • The interregion communications facility must be closed if the connection is an MRO connection. (You can use the SET IRC CLOSED command to close it.)
  • If the connection is an APPC connection and the local CICS system is a member of a z/OS Communications Server generic resource group, there can be no deferred work pending. Deferred work occurs when a failure causes a unit of work which has used a session on the connection at SYNCLEVEL 2 to be shunted (held for later disposition, because recovery action is required before disposition can be completed).

    Other types of connection can be discarded, even if there is recovery work outstanding for them. However, it is recommended that you do not discard them if there is. You can use the INQUIRE CONNECTION RECOVSTATUS command to check.

  • There can be no indirect CONNECTION definitions pointing to the connection to be discarded.
Note: In unusual circumstances, the discard of an LU6.1 connection can fail, even when it is out-of-service, if some of its sessions are still in-service. If this happens, set the connection status to INSERVICE, then OUTSERVICE, and then reissue the DISCARD command.

CICS completes successful DISCARD CONNECTION processing with an implicit syncpoint on behalf of the issuing task, committing changes to recoverable resources made up to that point in the task. If the discard processing fails, CICS raises the INVREQ exception condition with a RESP2 value of 27, and does a SYNCPOINT ROLLBACK instead, rolling back changes to recoverable resources. For all other exception conditions, however, discard processing is not attempted and neither SYNCPOINT nor SYNCPOINT ROLLBACK is issued.

See Discarding resource definitions for general information about DISCARD commands.

Options

CONNECTION(data-value)
specifies the 4-character identifier of the CONNECTION definition to be discarded.

Conditions

INVREQ
RESP2 values:
24
The connection is remote and is in use locally.
25
The connection is local and is not out-of-service.
26
Recovery information is outstanding for the connection which must be resolved before discard is allowed.
27
Discard processing failed.
28
Indirect connections point to the connection.
29
The connection is an MRO connection and IRC is not closed.
38
Discard of this connection is already in progress.
39
The CONNECTION definition is currently in use.
200
The command was executed in a program defined with an EXECUTIONSET value of DPLSUBSET or a program invoked from a remote system by a distributed program link without the SYNCONRETURN option.
NOTAUTH
RESP2 values:
100
The user associated with the issuing task is not authorized to use this command.
SYSIDERR
RESP2 values:
9
The connection cannot be found.