Ending affinities

When a session is established with a member of a generic resource, z/OS® Communications Server creates an association called an affinity between the generic resource member and the partner LU, so that it knows where to route subsequent flows.

In most cases, z/OS Communications Server ends the affinity when all activity on the session has ceased. However, for some types of session, z/OS Communications Server assumes that resynchronization data might be present, and therefore relies on CICS® to end the affinity. The following sessions are affected:
  • APPC synclevel 2 sessions
  • APPC sessions using limited resource support
  • LU6.1 sessions.

In z/OS Communications Server terms, the CICS generic resource member owns the affinity and is responsible for ending it. The affinity persists even after a connection is deleted or CICS has performed an initial or cold start. For a connection between two generic resources, both partners own an affinity, and each must be ended. For APPC connections between CICS TS for OS/390®, Version 1.3 or later regions, the APPC connection quiesce protocol does this automatically; see APPC connection quiesce processing. For other connections, the affinities must be ended explicitly.

CICS provides commands that can be used to end affinities explicitly:
  • You can use SET CONNECTION ENDAFFINITY when there is an installed connection definition.
  • You can use PERFORM ENDAFFINITY after an autoinstalled connection has been deleted, as well as when it is still present. You must supply the NETNAME (and, if the connection has been deleted, the NETID) of the remote system. The NETNAME is the name by which the remote system is known to z/OS Communications Server. (Note that, if the remote system is also a generic resource, the NETNAME is always the member name, even if the connection was defined using the generic resource name.)

These commands are valid only for LU6.1 and APPC connections. The connection, if present, must be out of service and its recovery status (as shown by the RECOVSTATUS option of the INQUIRE CONNECTION command) must be NORECOVDATA. Note that only those affinities that are owned by CICS can be ended by CICS.

CICS has no certain knowledge that an affinity exists for a given connection. To help you, whenever it is possible that an affinity has been created that you might have to end explicitly, message DFHZC0177 is issued. This message gives the NETNAME and NETID to be used on the PERFORM ENDAFFINITY command.

Having received message DFHZC0177, to check whether an affinity that must be ended explicitly does exist, you can use the SNA D NET,GRAFFIN command. This command produces messages IST1706 and IST1707, which should contain the information you need. Alternatively, produce a dump of the z/OS Communications Server ISTGENERIC data area. This dump contains SPTE records that show which affinities exist. For more information, see z/OS MVS IPCS Commands. For example, use the following command to start the dump:
DUMP COMM=(title)
Reply with the following command:
r xx ,STRLIST=(STRNAME=ISTGENERIC,
                  ACC=NOLIMIT,(LNUM=ALL,ADJ=CAP,EDATA=SER))
Use the following command to look at the dump:
STRDATA DETAIL ALLSTRS ALLDATA

If z/OS Communications Server rejects a request to end an affinity because no such affinity exists, message DFHZC0181 is issued. This can mean either that you supplied an incorrect NETNAME or NETID, or that the possible affinity does not actually exist.