120 pts.
 AS/400 Physical File update history
How can we find out the sequence of programs that have updated the fields of the given file.

For eg. If I have a file ABC and 10 programs have updated the file ABC, then how can we find out in which sequence the programs have updated the file ABC and what was the value in fields after each sequence?



Software/Hardware used:
ASKED: February 10, 2011  9:15 AM
UPDATED: February 15, 2011  6:33 PM

Answer Wiki:
You can do this by Jouirnalling the File CRTRCVJRN - Give it any name you want and usually best to put in th the same library as the objects you will journal. This is done for recovery process if ever needed. CRTJRN - Same as above STRJRNP - I usually omit the open/close and journal both the before and after images. This will automatically log every add/update/delete to the file with the data and additional information such as who, what, when, where. This can be done at anytime. If you decide to end the process at some time, you do an ENDJRNPF command * Here is a link to information regarding an easy way to display the information once collected. It is from a response question yesterday. http://itknowledgeexchange.techtarget.com/itanswers/as400-db2-3/
Last Wiki Answer Submitted:  February 10, 2011  3:21 pm  by  CharlieBrowne   32,895 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,895 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

without the file already being journalled there is no way to see this information. All you can do is journal the file and run the same programs again over the file to see the journal receiver details which will show you the programs and the order they are touched.

 2,310 pts.

 

Depending on how you dump the journal we can see the before and after result of each update and the sequence it happened. The output of the dump contains the entire record, but it is one string of data matching your physical record layout.

 695 pts.

 

The EXPJRNE will split that character string into individual fields.
Here is the link http://www.tools400.de/English/Freeware/Utilities/utilities.html
.

 32,895 pts.

 

As an alternative to journaling, you may create a trigger-program which writes a record with the ‘before-update’ data plus add’l info like program-name, timestamp, userid.
Thus you have full control in respect of which data your ‘log’ needs to contain.
This url brings you to explanatons and sample code on triggerprogramming.

Good luck

DanF

 2,540 pts.

 

sorry, – url is here:

 2,540 pts.

 

double sorry — next try:

 2,540 pts.

 

This is not to gain points – the ‘link’ in the editor is most probpably the cause to my problems to pass the url i refer above. I’ll give it a last try by putting it here as pain text:
http://publib.boulder.ibm.com/html/as400/v4r5/ic2979/info/db2/rbafomstrzahftrb.htm

If the url is not presented in this entry, then Google ‘ibm as400 triggerprogram’

 2,540 pts.

 

once journalling,the command CMPJRNIMG (compare journal images) is a big help to zero in on fields changed and order of the update programs.

 540 pts.