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

Commit Frequency in a PL1 DB2 program


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

New User


Joined: 02 May 2007
Posts: 3
Location: Bangalore

PostPosted: Thu May 03, 2007 11:26 am
Reply with quote

Hi,

Iam coding a PL1 DB2 program, where I need to give a commit frequency of 5. Iam using insert in 3 tables in the program. How do I specify 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: Thu May 03, 2007 7:26 pm
Reply with quote

Hello,

Please clarify this
Quote:
commit frequency of 5


It is a term that i'm not familiar with.
Back to top
View user's profile Send private message
Ramya Sundar

New User


Joined: 02 May 2007
Posts: 3
Location: Bangalore

PostPosted: Fri May 04, 2007 11:08 am
Reply with quote

Hi.

Commit frequency of 5 implies that I need to commit after 5 rows are inserted into the table. The program is a batch program with for example 100 records input at a time. How should I check that 5 inserts are completed and give commit. Is there any way to do this?
Hope now am clarifying your question.
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: Fri May 04, 2007 12:49 pm
Reply with quote

Hello,

Usually, commits are issued at the end of a LUW (logical unit of work) rather than after n updates. This is to facilitate recovery/restart. Has your recovery/restart process been defined?

Keep in mind that any and all external updates (files, reports including counters in the reports, etc) must be syncronized.

To do what your request is, you need only to define a counter, add 1 to it as processing is done, and issue a commit when the counter reaches 5 and reset the counter after each commit. Easy to do, but may or may not be what you need n case of an abend.
Back to top
View user's profile Send private message
Ramya Sundar

New User


Joined: 02 May 2007
Posts: 3
Location: Bangalore

PostPosted: Fri May 04, 2007 1:51 pm
Reply with quote

Thanks.....I will try 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: Fri May 04, 2007 7:43 pm
Reply with quote

You're welcome icon_smile.gif

As an afterthought, why is a commit being scheduled for every 5 adds? Seems like that is very frequent icon_confused.gif
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Fri May 04, 2007 8:47 pm
Reply with quote

Hi,

We used to use follwoing Procedure as

As we used to use a table which contains coulmns as Program name, Commit frequency, Commit length (not sure of name) and Program keys. As normally we used to have commit frequency as 500.

And we used to check two conditions as the number of rows inserted as 500 (if so increment the commit length). And used to move the key columns to the Program keys.

And when the program abends, update the corresponding key coulmns.

And your query should be modified as (i took three coulmns Name, Emp no and DOB as keys)

Name => :Host var1
and
Emp id => :Host var2
and
DOB => :Host var3.

And before openning the cursor, we used to check the check point table whether Program name and Program keys are not spaces.

If not spaces i will move the values from the Program keys to Var1, Var2 and Var3.


Hope this will help you. But sorry if you can't i think its not easy to explain it in mail.

Cheers
Ashwin
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 Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top