Question

  Asked: Jun 22 2005   5:55 AM GMT
  Asked by: pprasad123


Receiving journal entries


OS/400, iSeries, i5, Backup & recovery, Integration/Connectivity, Printing, Security, System monitoring, Tools, tips and tricks

Hi,

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

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



maybe you can take a look at

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/sm04/c4153046.pdf

good luck

Rita
  • AddThis Social Bookmark Button

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

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

LHrabar  |   Jun 23 2005  8:56AM GMT

Why not just keep the sequence number in your DB file. Before you add the record, chain with the sequence number. If the record is found, skip it. You can also store the last sequence number - either in a file or in a data area - and use it to control which journal entries you receive with the RCVJRNE command - one of the parms is starting sequence number.

As to automatically restarting the REVJRNE job:
1. Set a flag on the system(file or data area) showing the status of the job. Submit/Started/Completed.
2. Setup a scheduled job to run and check the flag. If it is not completed, resubmit the REVJRNE job. If it is started, check if the job is active. If not, resubmit it.

If you need more info, let me know.

I hope this helps.

Len Hrabar

 

TheQuigs  |   Jun 23 2005  9:38AM GMT

I’m not sure what you’re after. Are you trying to build a permanent record of the journal entries? If so, the Journal Receiver *JRNRCV is a better store — it can’t be changed whereas a DB2 table can be. We write programs that use RCVJRNE to build a work file and run then periodically run the report program. Then we simply pick a starting and ending point in time for which to receive the journal entries.

 

pprasad123  |   Jun 24 2005  12:26AM GMT

Hi All,

Thanks for the replies. I will implement your suggestions and get back if stuck again in some problem.

Thanks,
P.Prasad