Question

  Asked: May 11 2007   5:44 AM GMT
  Asked by: AyeYes400


Tracking Changes to Files


AS/400, Application development, Backup & recovery, AS/400 Career, CLP, DB2 universal database, Email, IBM Marketing Sound Off, PC/Windows Connectivity, Printing, RPG, RPGLE, Security, DataCenter, Web development

Requirement:-

To track any changes to Two files A and B and write fields of A and B to an output file C.
A is related to B (A.Employee = B.Employee)
Could you please suggest a good approach for this?
I am currently using the approach of journalling.
1. Both A and B are journalled.
2. If Any changes to A, then the fields of the changed record of A and corresponding record of B are written to C
3. If Any changes to B, then the fields of the changed record of B and corresponding record of A are written to C. (If already present, Update else insert)
Do you think this is a good approach?Please provide your valuable inputs.

Regards,
EsJay

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



Hi EsJay

Journalling the files is a good way to achieve what you want although as an alternative you could look at the use of database triggers.

A database trigger can be defined to call a program whenever the physical files are updated (or records created).

There are a lot of examples you can find via Google, search for "database triggers as400", although a good general page with an example can be found at http://www.tylogix.com/Articles/TriggerTechniques.htm

Hope it helps

All the best

Jonathan

test
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400, Development and Storage.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register