RPG/400 Trigger Program

AS/400 triggers
IBM iSeries
RPG/400 trigger program was suggested to develop a moving average computation. There's a rule that needs to be followed when posting a record in the computation. One rule is that all credit transactions be first posted in the computation - Is this possible in a trigger program? How could I implement this rule?

Software/Hardware used:
RPG/400, iSeries

Answer Wiki

Thanks. We'll let you know when a new response is added.

Elm021564 –

One thing to remember about trigger files; they are expensive!

The Trigger program runs in line with the current process. Can the user wait for the process to finish?

Trigger files are not field sensitive. You make a change to the FILE and the trigger responds. If you do not care if that field changed – Sorry, it launched a job.

OOPS! Do not forget about Object security.


Discuss This Question: 3  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    We can't answer the question without knowing the structures of any tables that are involved and the relationships between them. What file is the trigger program associated with? How is the "moving average" calculated -- where do the values come from? Once the calculation is done, where should the "moving average" be stored? Tom
    125,585 pointsBadges:
  • DanTheDane
    If the triggered proces (= triggerprogram) involves manu file-lookups, the penalty may be increased responsetime for the users. If you create a dataqueue and simply lets the tiggerpgm add a record with proper data to initiate the computations, file-accesses a.o., your triggered program will not be notably slower. Then create a program which reads the dataqueue, and does the processes needed. This pgm shall then be started as a batch-job. This designmodel has worked for one of my customers for several years, and they have never had any problems with this second solution for the job. The first solution, was a traditional triggerpgm doing all the lookups etc - at that did'nt work for them. DanF
    2,555 pointsBadges:
  • Featured Member: MurrayInfoSys - ITKE Community Blog
    [...] RPG/400 Trigger Program [...]
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: