Creating an affinity

You can use SM_CREAFF to create an affinity if one does not already exist in the transaction group established for the transaction.

The transaction group must be defined with an affinity type and lifetime. The affinity created will have the same affinity type and lifetime as defined in the transaction group.

You should review Affinity considerations before using SM_CREAFF.

Before calling SM_CREAFF, you must first call SM_SCOPE to obtain a scope list. SM_CREAFF will not create an affinity to an target region that is not in the scope list. In addition, you should set the EYUWRCOM communication area fields WCOM_SEL_AOR and WCOM_SEL_SYSID to the APPLID and SYSID, respectively, of the target region for which you want the affinity created.

EYU9WRAM contains a fragment of unexecuted code that you can use as a template for implementing the SM_CREAFF function.

The SM_CREAFF function cannot be called during:
  • Route termination
  • Route abend
  • Route notify
  • Route initiate
  • Route complete