View previous topic :: View next topic
|
Author |
Message |
kunal jain
New User
Joined: 19 May 2011 Posts: 59 Location: India
|
|
|
|
Hi,
I have to code a COBOL Program to fetch the records from a DB2 table.
Every fetched record needs to be inserted to another Db2 Table & also be written to MQ.
I am thinking to have Commit/Restart Logic.
Please let me know the way i can achieve this |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
are you speaking of Batch or CICS?
have you bothered to read anything about RRSAF?
RRS |
|
Back to top |
|
|
kunal jain
New User
Joined: 19 May 2011 Posts: 59 Location: India
|
|
|
|
Its a Batch program. Also The records in MQ are set to trigger task once the MQ has record.
Actually my program has both Db2 Insert & MQPUT.
So need ur suggestion in inluding Commit/Restart logic in my program.
I believe that only issuing MQPUT command will not write a record to MQ unless SRRCMIT is issued or that paritcular program(unit of work) has ompleted. Pls confirm if my understanding is correct. |
|
Back to top |
|
|
kunal jain
New User
Joined: 19 May 2011 Posts: 59 Location: India
|
|
|
|
I would like to rephrase my question on SRRCMIT:
At what instance a Record is actually being written to a MQ from a batch program?
I believe its only after SRRCMIT or when the program completes successfully.
Please confirm |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as db2 has rows not records
mqs has messages not records,
files only have records......
the message is not available to other tasks until
an explicit commit
or
a successful end of task with only an implicit commit.
if you issue an explicit commit (and receive an error free return)
and afterwards your program abends, the messages will still be available to other tasks. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
kunal jain
New User
Joined: 19 May 2011 Posts: 59 Location: India
|
|
|
|
Thanks..my thinking was correct!
Thank you so much for the information & help!!
Much Appreciated |
|
Back to top |
|
|
|