Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Commit Frequency in a PL1 DB2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Commit Frequency in a PL1 DB2 program
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

Site Director


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

PostPosted: Thu May 03, 2007 7:26 pm    Post subject:
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    Post subject: Re: Commit Frequency in a PL1 DB2 program
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

Site Director


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

PostPosted: Fri May 04, 2007 12:49 pm    Post subject:
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    Post subject: Re: Commit Frequency in a PL1 DB2 program
Reply with quote

Thanks.....I will try this.
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: Fri May 04, 2007 7:43 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us