Receiving journal entries
I am new to AS400, so need some help in solving a problem. I have tried to some extent but things seem to be more complicated than I thought.
Problem Goal: receiving entries from a journal and putting them into a DB2 table in a predefined format(say Type5).
RCVJRNE command can be used to specify an exit program that will receive entries from the journal. From within this Exit program, I can open the pre-created DB2 table and write into it. But the main problem I am facing is how to maintain the last processed journal entry sequence number. It can happen that due to some reason my exit program completes or is killed. When I execute RCVJRNE command again, my exit program will receive all the entries from the beginning. I guess I need to call the RCVJRNE from within a CL program and maintain the sequence number on the disk, so that I can read it at the time the job is restarted. Also is there a way to make sure that if the job containing RCVJRNE is stopped somehow, it is automatically restarted and RCVJRNE is run. All required info can be got from the CL programming guide & iSeries Info center but seems to be too big to go through for a quick solution. Any suggestions will be greatly helpful.
Thanks,
P.Prasad



