Understanding applications for user exits

Table F-1 describes situations for which you can write a user exit, methods of programming for those situations, alternatives to programming a user exit, and considerations for programming a user exit.

Table F-1: User exit uses, programming methods, and alternatives

In this situation...

What you can do

For user exit details, see

The replicate table name differs from the source table name.

With a user exit:

  • Change the physical table name by supplying a new replicate table name in the value of LEPHYSTB (44 characters maximum). If the first byte of LEPHYSTB contains binary zeroes (x’00’), then the next 4 bytes can contain a pointer to a larger table name (45 - 128 bytes). The table name data at that pointer must have a two byte length followed by the name string.

NoteAlways check the maximum length of tables names in the Replication Server and target data base documentation to ensure that those servers will accept large table names.

Alternate methods:

  • Change the value of the REPLICATE_NAME column in the LTMOBJECTS table, if appropriate, to optimize performance.

  • Change the replicate table name in the replication definition (if you are using Replication Server 11.5 or later)

.

Table F-5: “LE Command structure contents”

The replicate column names differ from primary record or segment names.

With a user exit:

  • Change column names by setting values for the @COL_NAME and @COL_NAME_LENGTH attributes. If the first three bytes of @COL_NAME contain binary zeroes (x’000000’), then the next 4 bytes can contain a pointer to a larger table name (19 - 128 bytes). The column name at that pointer must have a two byte length, followed by the name string.

NoteAlways check the maximum length of table names in the Replication Server and target database documentation to ensure that those servers will accept large table names.

Alternate method:

  • Create Replication Server function strings.

  • Change the replicate column name in the replication definition (if you are using Replication Server 11.5 or later).

Table F-7: “COL structure contents”

The replicate definition does not contain all of the columns in the primary record or segment.

With a user exit:

Specify to not replicate a specific column by setting the value of the @COL_TYPE attribute to @COL_DONOT_REPL.

Alternate method:

Set the value of the Use_repdef LTM for z/OS configuration parameter to Y to reduce network traffic and increase throughput.

Table F-7: “COL structure contents”

The datatype of your primary data is incompatible with the replicate data.

With a user exit:

  • Change the value of the @COL_TYPE attribute of the COL message structure to convert datatypes as needed.

    For example, you can preserve all digits in timestamp columns by doing the following:

  1. Define the columns as char(26) in the replication definition and in the replicate table.

  2. Set the value of the @COL_TYPE attribute to @COL_TYP_CHAR.

  3. Convert timestamp data to char representation.

Alternate method:

  • Use the date and time conversion configuration parameters to convert Replication Agent-supported date, time, and timestamp data to char representations.

  • Create Replication Server function strings.

Table F-7: “COL structure contents”

The replicate column values differ from primary record or segment values.

With a user exit:

  • Change the area pointed to by the @RPTCOL_REDO and @RPTCOL_UNDO attributes of the @RPTCOL message structure

  • Change the @COL_LENGTH value as appropriate.

Alternate method:

  • Create Replication Server function strings.

Table F-6: “@RPTCOL structure contents”

Columns must be added to the primary transaction operation to match the replicate table.

With a user exit:

  • Add @RPTCOL nodes to the end of the @RPTCOL list in the LE Command structure.

Alternate method:

  • Create Replication Server function strings.

Table F-6: “@RPTCOL structure contents”

Custom message(s) must be logged by Replication Agent.

With a user exit:

  • Place a pointer to a list of message nodes in the @APLOGMSG attribute of the user exit communications area.

Table F-3: “User exit communications area structure”

LTM for MVS must be shut down.

With a user exit:

  • Either set Register 15 to return a code other than 0, or set the value of the APFATAL attribute of the user exit communications area to Y.

The transaction operation must not be replicated.

With a user exit:

  • Set the value of the APREPSW attribute of the user exit communications area to N to reduce network traffic (especially when where clauses in your subscriptions filter a large number of transaction operations).

Alternate method:

  • Create Replication Server function strings.

Table F-3: “User exit communications area structure”

DB2 GRAPHIC and VARGRAPHIC datatypes must be replicated.

With a user exit:

  • Define the columns as binary to ASE.