IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Incremental Update from IMS DB to DB2


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mailbalaji

New User


Joined: 13 Mar 2006
Posts: 7
Location: Chennai

PostPosted: Tue May 11, 2010 8:36 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 11, 2010 9:47 pm
Reply with quote

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
View user's profile Send private message
mailbalaji

New User


Joined: 13 Mar 2006
Posts: 7
Location: Chennai

PostPosted: Wed May 12, 2010 12:14 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 12, 2010 5:14 am
Reply with quote

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
View user's profile Send private message
mailbalaji

New User


Joined: 13 Mar 2006
Posts: 7
Location: Chennai

PostPosted: Wed May 12, 2010 8:29 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 12, 2010 8:40 am
Reply with quote

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
View user's profile Send private message
mailbalaji

New User


Joined: 13 Mar 2006
Posts: 7
Location: Chennai

PostPosted: Thu May 20, 2010 7:01 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 20, 2010 8:43 pm
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Read a flat file and update DB2 table JCL & VSAM 2
No new posts how to update an ISR appl var from an... TSO/ISPF 8
No new posts DB2 SQL query to read and update data... DB2 12
No new posts SKIP LOCKED DATA in UPDATE statement DB2 9
No new posts Group comparison/update between two f... DFSORT/ICETOOL 10
Search our Forums:

Back to Top