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

Commit after every 1000 rows


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ashishsr123

New User


Joined: 06 May 2008
Posts: 33
Location: Chennai

PostPosted: Sat Jun 13, 2009 12:42 am
Reply with quote

Hello,

I want to devise a cobol-db2 program and commit after every 1000 rows . What are the
1)possible
2) Most efficient
way out.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Jun 13, 2009 1:24 am
Reply with quote

i just maintain a counter (incremented after every SELECT/FETCH/UPDATE - whatever) and check it for 1000 and when it is 1000, COMMIT and reset the counter.

I would suggest reading the links provided in this thread
Back to top
View user's profile Send private message
ashishsr123

New User


Joined: 06 May 2008
Posts: 33
Location: Chennai

PostPosted: Sun Jun 14, 2009 5:07 pm
Reply with quote

We can use checkpoint restart table also for committing...can someone throw some more light on this, I am not fully aware of this.
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: Sun Jun 14, 2009 10:20 pm
Reply with quote

Hello,

If your organization has implemented some kind of restart table it is completely site-specific. You need to speak with your dba or project senior as to how this is implemented and used on your application (if it is at all).

In about 99% of the applications these days (due to the incredible sppe increase in cpus and dasd) there is no reason to build in restart procedures. It is cleaner to simply restart from the beginning.

Depending on what functions the process provides, properly implementing restart may be far from trivial. Most large batch update jobs (which are the ones that might even be candidates for restart) do more than simply update tables. Audit trail reports are often created, sequential files may be created and so on. Everything must be re-synchronized if a restart is to be implemented.

Keep in mind that jobs should run to successful completion and if one does regularly not run successfully, that job needs to be fixed. If the code is so poor that it will not run correctly, an attempt at implementing restart will probably cause more problems than it provides benefit.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts How to compare two rows of same table DB2 11
Search our Forums:

Back to Top