Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Incremental Update from IMS DB to DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: Incremental Update from IMS DB to DB2
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

Site Director


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

PostPosted: Tue May 11, 2010 9:47 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed May 12, 2010 5:14 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed May 12, 2010 8:40 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu May 20, 2010 8:43 pm    Post subject: Reply to: Incremental Update from IMS DB to DB2
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    IBMMAINFRAMES.com Support Forums -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Using DFDSS for incremental backups dionluke JCL & VSAM 3 Wed Jun 01, 2016 1:02 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us