IBM Books

Replication Guide and Reference


Setting up the Apply program

This section describes setting the Apply program generally. See the appropriate chapter in Operations for your operating system environment for specific information about setting up the Apply program.

Refreshing target tables with the ASNLOAD exit routine

The Apply program can call the ASNLOAD exit routine whenever it performs a full refresh of a target table. Specify the LOADX parameter to cause the Apply program to call this routine.

You can use the ASNLOAD routine as shipped with the Apply program, or you can modify it. As shipped, the routine uses the DB2 EXPORT utility to export data from the source table and uses the DB2 LOAD utility to fully refresh the target table. You can modify the ASNLOAD routine to call any IBM or vendor utility. See the prolog section of the sample program (ASNLOAD.SMP) in the \sqllib\samples\repl directory for information about how to modify this exit routine.

You must use the ASNLOAD routine to fully refresh tables with referential integrity constraints in order to bypass referential integrity checking.

If your source servers are password protected, you must modify the ASNLOAD routine to provide the password file. However, if the password is administered by DB2 Universal Database Satellite Edition, the ASNLOAD routine does not require a password file, and you can use the IBM-supplied routine.

See Refreshing target tables with the ASNLOAD exit routine for AS/400 for information about using the ASNLOAD routine in an AS/400 environment.

Files generated on Windows and UNIX

When you run the ASNLOAD routine, it generates the following files:

Files generated on OS/2

When you run the ASNLOAD routine, it generates the following files:

Error handling

If an error occurs while the Apply program calls the ASNLOAD routine, or if the routine returns a nonzero return code, the Apply program issues a message, stops processing the current subscription set, and processes the next subscription set.

Using the ASNDONE exit routine

The Apply program can optionally call the ASNDONE exit routine after subscription processing completes, regardless of success or failure. You can modify this routine as necessary, for example, the routine can examine the UOW table to discover rejected transactions and initiate further actions, such as issuing a message or generating an alert. Another use for this exit routine is to deactivate a subscription set that fails (status = -1), and thus avoid retry by the Apply program until the failure is fixed.

See the prolog section of the sample program (ASNDONE.SMP) in the \sqllib\samples\repl directory for information about how to modify this exit routine. For AS/400, the following table indicates where you can find the source code for this routine:
Compiler language Library name Source file name Member name
C QDPR QCSRC ASNDONE
COBOL QDPR QCBLLESRC ASNDONE
RPG QDPR QRPGLESRC ASNDONE

See Using the ASNDONE exit routine for AS/400 for more information about using the ASNDONE exit routine in an AS/400 environment.

To use the ASNDONE exit routine:

  1. Modify the ASNDONE routine to meet your site's requirements.

  2. Compile the program and place the executable in the appropriate directory.

  3. Start the Apply program with the NOTIFY parameter to call the ASNDONE exit routine.

The parameters that the Apply program passes to the ASNDONE exit routine are:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]