7 User Exit Functions
User exits extend and customize the functionality of the Extract and Replicat processing by calling COBOL, TAL or C routines from the Extract or Replicat parameter files. At different points during processing you can invoke custom COBOL, TAL or C routines to perform specialized functions.
Reference Guide for HP NonStop (Guardian) provide:
-
Function parameters for accepting and processing different events and information from Extract or Replicat.
-
Calling environment functions, in TAL, C and COBOL, for retrieving context information from Extract or Replicat.
Two example user exits are supplied with the installation code: DEMOXCOB
(written in COBOL) and DEMOXC
(written in C). You can use these exits as a sample to help plan your own user exit routines. Two blank user exit templates are also included: USEREXC
for C
and USEREXT
for TAL
. You can use these to start coding your routines. There is no sample for TAL
and no template for COBOL
.
Note:
User exits may be used for many kinds of routines; however, you should avoid controlling transaction commits with custom user exit logic. This could interfere with Oracle GoldenGate checkpoint processing, which facilitates troubleshooting and protects you in case of system failure.
7.1 SET_TARGET_FILENAME_EXTERNAL
Use SET_TARGET_FILENAME_EXTERNAL
to set the file name target record
using an external format. This is the required call to change a file name in ANSI format.
Valid only for Extract.
Syntax
For C:
#include "usrdecs" short result; char *filename; short filename_len; result = SET_TARGET_FILENAME_EXTERNAL (char *filename, short filename_len);
For TAL:
?source usrdect int result; string .ext filename_name; int .filename_name_len; result := SET_TARGET_FILENAME_EXTERNAL (filename_name, filename_name_len);
For COBOL:
?CONSULT =EXTRACT 01 result PIC S9(4) COMP. 01 filename PIC x(48). 01 filename-len PIC S9(04) COMP. ENTER C "GET_COLUMN_NAME" using filename, filename-len, max-name-len, source-or-target giving result.