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

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

Return Code (RTNCD)
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 (PGMNM)
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 (ENTRYB)
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 (BDATA)
The row before image in the source table.
Publisher After Image (ADATA)
The row after image in the source table.
Publisher Before Image NULL Indicator Count (BNULCB)
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 (ANULCB)
The number of NULL-capable fields in the after image. Each NULL-capable field will have a NULL indicator.
Publisher Before Image NULL Indicators (BNULL)
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 (ANULL)
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 (BJRNL)
Journal control information associated with the before image.
Publisher After Image Journal Data (AJRNL)
Journal control information associated with the after image.
Subscriber Final Image Length (DTLNGT)
The length of the fully formatted (final) image that will be applied to the target table.
The fully formatted (final) image and the length of this image will contain inconsistent information in the certain situations. For example, in the situation where the subscriber job is operating under SQL update mode (in the target system parameters), an update operation is performed, and there are target 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 (ATDATA)
The fully formatted (final) image that will be applied to the target table.
Note: When the subscriber job is operating under SQL update mode (in the target system parameters), an update operation is performed, and there are target 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.
The fully formatted image contains the results of data transformations applied to the replicated after image in the target environment. For target tables that have been mapped 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.
Subscriber Final Image NULL Indicator Count (NULCNT)
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 (NULIND)
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 (SYSTEM)
The source identifier identifying the subscription containing the source table. Source identifiers and subscriptions are defined in Management Console.

Both the BJRNL and AJRNL parameters contain the following journal control fields.

Journal Entry Length (JOEENTL)
The length of the journal entry that includes the entry length field and all subsequent positions of the journal entry.
Journal Sequence Number (JOSEQN)
The sequence number assigned to the journal entry by the system.
Journal Name (JOJRN)
The name of the journal.
Journal Library (JOJRNLIB)
The name of the library where the journal is located.
Journal Receiver (JORCVNME)
The name of journal receiver attached to the journal.
Journal Receiver Library (JORCVLIB)
The name of the library where the journal receiver is located.
Journal Entry Code (JOCODE)
The primary category of the journal entry.
Journal Entry Type (JOENTT)
The type of user-created or system-created entry.
System Entry Type (ENTTSYS)
The type of system-created entry.
Journal Entry Timestamp (JOTSTP)
The system date and time when the entry was journaled.
Publisher Job Name (JOJOB)
The name of the job that generated the journal entry.
Publisher Job User (JOUSER)
The user profile of the user that started the job.
Publisher Job Number (JONBR)
The job number of the job generated the journal entry.
Publisher Program Name (JOPGM)
The name of the program that generated the journal entry.
Source Table Name (JOOBJ)
The name of the source for which the journal entry was generated.
Source Table Library (JOLIB)
The name of the library containing the source table.
Source Table Member Name (JOMBR)
The name of the physical file member.
Publication RRN (JOCTRR)
The relative record number (RRN) of the row that caused the journal entry or a count that is pertinent to the specific type of journal entry.
Journal Flag (JOFLAG)
Based on the type of entry, indicates whether or not there is extended information.
The following values determine whether or not extended information is presented:
  • 1—Extended information is available.
  • 0—No extended information is available.
The extended information is placed immediately after the Entry Specific Data and will have the following structure:
Length (4 bytes)
Total length of the extended entry.
Format (7 bytes)
Format of extended information.
Currently, it is ‘DM_0100'.
Extended Object Name (128 bytes)
Full name of source table.
Extended Schema Name (137 bytes)
Full name of source schema.
Commit Cycle ID (JOCCID)
The number that identifies the commit cycle. This number only applies to an entry associated with a commitment transaction.
Publisher Job User (JOUSPF)
The name of the user profile under which the job was running when the entry was created.
Publication Server Name (JOSYNM)
The name of the system on which the journal entry was generated.

The total length of all journal control fields is 191. This is equal to the defined size of both the BJRNL and AJRNL parameters.