Entry parameters for table-level and row-level user exits in COBOL

The following list describes each parameter in the entry parameter list that must be defined in each COBOL table/row-level user exit program.

Return Code (LK-RETURN-CODE)
The return code that indicates whether or not the user exit program was successful. In the user exit program, return an error message ID if errors occurred in the user exit program or blank characters if no errors occurred in the user exit program.
User Exit Program Name (LKPROGRAM)
The name of the user exit program that was called. This is the name of the program that you specify in Management Console.
User Exit Point (LK-ENTRY)
The table/row-level user exit point where the user exit program was called.
These are the possible returns:
  • 1—Before Clear
  • 2— After Clear
  • 3—Before Insert
  • 4—After Insert
  • 5—Before Update
  • 6—After Update
  • 7—Before Delete
  • 8—After Delete
  • 9—Before Refresh
  • 10—After Refresh
Publisher Before Image (LK-BEFORE-RECORD)
The row before image in the source table.
Publisher After Image (LK-AFTER- RECORD)
The row after image in the source table.
Publisher Before Image NULL Indicator Count (LK BEFORE-NULLIND-CNT)
The number of NULL-capable fields in the before image. Each NULL-capable field will have a NULL indicator.
Publisher After Image NULL Indicator Count (LK-AFTER-NULLIND-CNT)
The number of NULL-capable fields in the after image data. Each NULL-capable field will have a NULL indicator.
Publisher Before Image NULL Indicators (LK-BEFORE-NULLINDS)
NULL indicators for all NULL-capable fields in the before image.
These are the possible returns:
  • 0—NULL-capable field is not set to NULL.
  • 1—NULL-capable field is set to NULL.
Publisher After Image NULL Indicators (LK-AFTER-NULLINDS)
NULL indicators for all NULL-capable fields in the after image.
These are the possible returns:
  • 0—NULL-capable field is not set to NULL.
  • 1—NULL-capable field is set to NULL.
Publisher Before Image Journal Data (LK-BEFORE-JOURNAL)
Journal control information associated with the before image.
Publisher After Image Journal Data (LK-AFTER-JOURNAL)
Journal control information associated with the after image data.
Subscriber Final Image Length (LK-DATA-LENGTH)
The length of the fully formatted (final) image that will be applied to the target table.
Note: The parameters containing the fully formatted (final) image and the length of this image will contain inconsistent information in the following situation: when the subscriber job is operating under SQL update mode (in the subscription system parameters), an update operation is performed, and there are subscription columns with default values. In this case, the length of the final image and the image itself will not include the columns with the default values. Therefore, the length of the final image for a row update operation will be shorter than the length of the final image for a row insert operation.
Subscriber Final Image (LK-DM-BUFFER)
The fully formatted (final) image that will be applied to the target table. The fully formatted image contains the results of data transformations that may have been applied to the replicated after image in the target environment. For target tables that have been assigned under summarization, row consolidation (one-to-one and one-to-many), and adaptive apply, this image, in before user exit program invocations, will contain only default values (blanks, zeroes, and so on) instead of the final image.
Note: The parameters containing the fully formatted (final) image and the length of this image will contain inconsistent information in the following situation: when the subscriber job is operating under SQL update mode (in the subscription system parameters), an update operation is performed, and there are subscription columns with default values. In this case, the length of the final image and the image itself will not include the columns with the default values. Therefore, the length of the final image for a row update operation will be shorter than the length of the final image for a row insert operation.
Subscriber Final Image NULL Indicator Count (LK DM-NULLIND-CNT)
The number of NULL-capable fields in the fully formatted (final) image. Each NULL-capable field will have a NULL indicator.
Subscriber Final Image NULL Indicators (LK-DM-NULLINDS)
NULL indicators for all NULL-capable fields in the fully formatted (final) image
These are the possible returns:
  • 0—NULL-capable field is not set to NULL.
  • 1—NULL-capable field is set to NULL.
Source identifier (LK-SYSTEMID)
The source identifier identifying the subscription containing the source table. Source identifiers and subscriptions are defined in Management Console.

Both the LK-BEFORE-JOURNAL and LK-AFTER-JOURNAL variables in the linkage section contain the journal control fields listed in Entry parameters for table-level and row-level user exits in RPG.