When a session is established with a member of a generic resource, VTAM® 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, VTAM ends the affinity when all activity on the session has ceased. However, for some types of session, VTAM assumes that resynchronization data may be present, and therefore relies on CICS® to end the affinity. The sessions affected are:
In VTAM terms, the CICS generic resource member "owns" the affinity and is responsible for ending it. The affinity persists even after a connection has been 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 OS/390®, Version 1 Release 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:
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, message DFHZC0177 is issued whenever there is a possibility that an affinity has been created that you may have to end explicitly. 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 indeed 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, the MVS/ESA Version 5 Interactive Problem Control System (IPCS) Commands manual, GC28-1491, tells you how to produce a dump of the VTAM ISTGENERIC data area. This contains SPTE records that show which affinities exist. For example, start the dump with:
DUMP COMM=(title)
Reply with:
r xx ,STRLIST=(STRNAME=ISTGENERIC,
ACC=NOLIMIT,(LNUM=ALL,ADJ=CAP,EDATA=SER))
Look at the dump with:
STRDATA DETAIL ALLSTRS ALLDATA
If a request to end an affinity is rejected by VTAM because no such affinity exists, message DFHZC0181 is issued. This may mean either that you supplied an incorrect NETNAME or NETID, or that you (or CICS) were wrong in supposing that an affinity existed.
You need to end affinities if you reconfigure your sysplex. For example, you must end any relevant affinities before you do any of the following:
If a generic resource member that owns affinities fails and cannot be recovered, the affinities must be ended. In a case like this, you cannot use the SET CONNECTION ENDAFFINITY or PERFORM ENDAFFINITY commands. Instead, you can use a batch program to clear the affinities owned by the failed member. This section demonstrates how to write such a batch program. The program must be written in assembler language.
You should use this technique only if it is impossible to restart the failed CICS system.
The following input parameters are needed:
The program uses the VTAM CHANGE OPTCD=ENDAFFIN macro to end the affinities. You will probably need to produce a report on the success or failure of this and the other VTAM macro calls that the program uses. Consult the OS/390 eNetwork Communications Server: SNA Programming manual for the meaning of RTNCD/FDB2 values.
acb-name ACB AM=VTAM,
PARMS=(PERSIST=YES)
Note that the above example assumes that you are using persistent sessions.
rpl-name RPL AM=VTAM,OPTCD=(SYN)
nib-name NIB
'VARY NET,TERM,LU1=applid1,LU2=applid2,TYPE=FORCE,SCOPE=ALL'
SENDCMD RPL=rpl-name,
ACB=acb-name,
AREA=output-area,
RECLEN=command-length,
OPTCD=(SYN)
RCVCMD RPL=rpl-name,
ACB=acb-name,
AREA=input-area,
AREALEN=receive-length,
OPTCD=(SYN,TRUNC)
CHANGE RPL=rpl-name,
ACB=acb-name,
NIB=nib-name,
OPTCD=(SYN,ENDAFFIN)
//JOBNAME JOB 1,userid,
// NOTIFY=userid,CLASS=n,MSGLEVEL=(n,n),MSGCLASS=n,REGION=1024K
//*
//JOBLIB DD DSN=loadlib-name,DISP=SHR
//*
//*******************************************************************
//* PARM='FAILED_APPLID,FAILED_GENERIC,PARTNER_NETID,PARTNER_APPLID'
//*******************************************************************
//*
//RUN EXEC PGM=ENDAFFIN,PARM='parm1,parm2,parm3,parm4'
//*
//REPORT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//