View previous topic :: View next topic
|
Author |
Message |
mailbalaji
New User
Joined: 13 Mar 2006 Posts: 7 Location: Chennai
|
|
|
|
Hi,
I have a particular scenario in one of my requirements.
There is an IMS database which is being updated by a IMS DC screen.
My requirement will be a Batch program that needs to do the following.
1st Run:
All the records from the IMS DB needs to be inserted into the DB2 table. [I have completed this]
2nd & concecutive runs:
Only the new records that are added into IMS DB needs to be inserted in DB2 and the records that have been changed in IMS DB needs to be updated in DB2.
Can any one of you please help me on how to arrive at the 2nd point? Any pseudocode will also be helpful for me.
Thanks,
Balaji |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Do you intend to update the db2 data at the same time as the ims data or will the ims processing complete before the db2 processing begins? |
|
Back to top |
|
|
mailbalaji
New User
Joined: 13 Mar 2006 Posts: 7 Location: Chennai
|
|
|
|
The IMS process will happen anytime. But the DB2 batch update happens at end of every day as per the Job Stream.
So, whatever updates have happened in IMS before the batch runs should be reflected [incrementaly] in DB2
dick scherrer wrote: |
Hello,
Do you intend to update the db2 data at the same time as the ims data or will the ims processing complete before the db2 processing begins? |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If the ims data contains a date/time you should be able to create a qsam file containing anything for the time-frame.
Then read this file and read the db2 table for the same key. If it exists in db2, update. If it does not exist, insert.
Deletes would be a different issue. |
|
Back to top |
|
|
mailbalaji
New User
Joined: 13 Mar 2006 Posts: 7 Location: Chennai
|
|
|
|
This is where the real problem arises. There is no timestamp or date field in the IMS database. That is where the real struggle is.
Please help me out.
dick scherrer wrote: |
Hello,
If the ims data contains a date/time you should be able to create a qsam file containing anything for the time-frame.
Then read this file and read the db2 table for the same key. If it exists in db2, update. If it does not exist, insert.
Deletes would be a different issue. |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Then write some code that extracts the entire ims data into as many qsam files as needed. Each day compare today's files against yesterday's nfiles and generate the file(s) i mentioned above.
When the "incremental" maintenance files have been created, apply them to the db2 environment.
Or, go back and put a date/timestamp in the ims data. |
|
Back to top |
|
|
mailbalaji
New User
Joined: 13 Mar 2006 Posts: 7 Location: Chennai
|
|
|
|
dick scherrer wrote: |
Hello,
Then write some code that extracts the entire ims data into as many qsam files as needed. Each day compare today's files against yesterday's nfiles and generate the file(s) i mentioned above.
When the "incremental" maintenance files have been created, apply them to the db2 environment.
Or, go back and put a date/timestamp in the ims data. |
Hi,
I have implemented this using batch code by verifying the data as suggested by you and it's working fine.
Thanks
Balaji |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
|