× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



My sugestion: change the format of the history file, make it twice as long and store the before and after in the same record. You can also add other fields like user , time, program, etc.

Another option is to use the journal instead of a trigger.

Vijaykrishna_Malladi wrote:

Hello folks,

I have a Query on triggers in AS400.
We have an update trigger program (coded in RPGLE) on  a Physical file which 
writes 2 records for an update (Before Image, say BI and After image, say AI of 
the record being updated in the PF) into another PF which we call as a history 
file.
We want to process the History file in the same sequence, i.e., the BI and AI 
should be in pairs. so that we can read them sequentially and by the change 
code field in the 2nd file, we determine whether it is BI or AI.

My problematic situation is: Suppose if two batch programs are updating the same 
file, there may be a chance that a BI for one of them is written in the History 
file and before the AI is written, the BI of some other record update would be 
written (even though, we have coded the write statements for the BI & AI, 
immediately one after other). This may happen because AS400 is very fast. Actually 
will this happen? if a trigger program is running, will it run only in one 
instance? or multiple instances is also possible at the same time?

Any help in this would be highly appreciated. Since we are executing a big 
project based on this here.

Thanks in Advance,
Regards,
Vijay



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.