When you are defining the connection between CICS® and DB2®, you can choose to have CICS connect to a specific DB2 subsystem. You can specify the name of this DB2 subsystem using the DB2ID attribute of the DB2CONN definition. However, if you have multiple DB2 subsystems that are using DB2 Version 7 or later, you might want to use DB2's group attach facility to make it possible for CICS to connect to any of your subsystems, rather than just one named subsystem. (Group attach for CICS is not available in releases of DB2 earlier than Version 7.) For full details of the CICS DB2 configuration needed to use the DB2 group attach facility, see Migrating to a different release of DB2.
Group attach is a DB2 facility that allows CICS to connect to any one member of a data-sharing group of DB2 subsystems, rather than to a specific DB2 subsystem. The group attach facility chooses any one member of the group that is active on the local MVS™ image for the connection to CICS (members that are active on other MVS images are not eligible for selection). If you use the DB2GROUPID attribute of the DB2CONN definition to specify the ID for the group of DB2 subsystems, instead of using the DB2ID attribute to specify the ID of an individual DB2 subsystem, you will activate the group attach facility. This means that you can use a common DB2CONN definition, specifying a group ID, across multiple cloned AORs, and CICS will connect to any active member of that data-sharing group. See the CICS Resource Definition Guide for information on how to define and install a DB2CONN definition.
If you are using group attach and the connection between CICS and DB2 is broken, CICS might not reconnect to the same DB2 subsystem--it might choose a different member of the data-sharing group of DB2 subsystems. This means that if indoubt UOWs are being held by the first DB2 subsystem to which CICS connected, they cannot be resolved. The RESYNCMEMBER attribute of the DB2CONN definition can be used to solve this problem. See Resolving indoubt units of work (UOWs) for information on the RESYNCMEMBER attribute and how to set it.
After the connection has been established, you can use the CEMT or EXEC CICS INQUIRE DB2CONN DB2ID() command to find out which member of the data-sharing group has been chosen for the current connection. See CICS Supplied Transactions for the CEMT command, and the CICS System Programming Reference for the EXEC CICS command.
If group attach is set but you want CICS to connect to a specific DB2 subsystem, you can override group attach. For example, if you want CICS to connect to the DB2 subsystem with an ID of "xyz", you can specify the DB2ID using:
Each of these methods overrides group attach by setting a DB2ID in the installed DB2CONN definition.
Specifying a DB2ID by any of these methods causes the DB2GROUPID attribute of the installed DB2CONN definition to be blanked out. If you want to revert to using group attach, set the DB2GROUPID attribute again using a CEMT or EXEC CICS SET DB2CONN DB2GROUPID() command.
Specifying a DB2ID on the INITPARM=(DFHD2INI=db2id) system initialization parameter does not override group attach--if a DB2GROUPID is set in the DB2CONN definition, the INITPARM setting is ignored. See the CICS System Definition Guide for more information on using INITPARM.
You cannot specify a DB2GROUPID using the INITPARM system initialization parameter, or using the DSNC STRT command.