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

How a COMMIT logic can be coded After loading 1000 records


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anil_jdh

New User


Joined: 05 Apr 2006
Posts: 4

PostPosted: Tue Apr 17, 2007 5:23 pm
Reply with quote

A COBOL-DB2 program is reading a flat file and loading the data from that file to a DB2 table. After loading 1000 records how a COMMIT logic can be coded.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Apr 17, 2007 10:13 pm
Reply with quote

For starters, try looking in the manual under COMMIT.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Apr 18, 2007 4:31 pm
Reply with quote

You can declare a counter variable, go on incrementing that after each updation and commit when it reaches 1000. But in case of abend you will still not be able to get the record for which the program abended so always implement the restart logic.
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Tue May 15, 2007 5:56 pm
Reply with quote

pass commit count through PARM parameter. keep count in the COBOL program. once the count in program exceeds the PARM count, COMMIT all the data.
Back to top
View user's profile Send private message
deepak.vl

New User


Joined: 17 Feb 2007
Posts: 38
Location: Hyderabad

PostPosted: Sun May 27, 2007 8:07 pm
Reply with quote

But this may create problems if the job abends in between. You need to restart the loading from the record which is next to the record which was last committed. This may not be possible in this case, since the input is from a flat file and you cannot direcly identify the records that were committed.

In my opinion, it is better not to have any commit logic in these scenarios.
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top