IBM Support

RPGLE considerations for Trigger programs

Question & Answer


Question

Errors RNX8888 and MCH1210 may be encountered by RPGLE trigger programs.

Answer

For performance reasons, Trigger programs often will produce multi-threaded jobs. This can cause some unexpected results if the trigger program is written in RPGLE. Please take the following into consideration:

1. Since the trigger program is running in a multi-threaded job, the RPGLE modules must be made thread safe. One of the major thread-safety issues is the handling of static storage. When multiple threads access the same storage location at the same time, unpredictable results can occur. One common error message is the program unexpectedly failing with an MCH1210 message. To make the module thread-safe you must specify either:
THREAD(*SERIALIZE) or THREAD(*CONCURRENT).

The RPG Reference manual has additional details about the THREAD keyword on page 370:
https://www.ibm.com/docs/en/ssw_ibm_i_75/pdf/sc092508.pdf


2. Since the Trigger program is executed in a mult-threaded environment, this can lead to recursive calls to the RPGLE program. This will result in RNX8888 error messages. To avoid this, the program needs to be compiled with:
DFTACTGRP(*NO) ACTGRP(*NEW)

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHtAAM","label":"Programming ILE Languages"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Document Information

Modified date:
09 December 2024

UID

nas8N1022127