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

Commit in COBOL-DB2 Subprogram


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Fri Nov 06, 2009 10:31 am
Reply with quote

Hi All,

I would like to know does Cobol Issues a implicit Commit when a Cobol-DB2 Subprogram returns control back to mail program.

My requirement as below:

1. Read an Input file in Main program and insert file record in a table by
calling a subprogram.
2. Now my subprogram failed for 2nd record so as per my understanding
1st Inserted record will roll back
3. But when I tried restart the program it gave me -803 for the 1 st
record and the program failed again

Would anyone please let me know the reason behind this or provide any documentation about this..

Thanks in advance

Chandan
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 Nov 06, 2009 10:37 am
Reply with quote

Hello,

Returning from a called module does not issue a commit.

Sounds like there is something amiss with the code.

Look for other commits in the code.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Fri Nov 06, 2009 1:30 pm
Reply with quote

Did the program abend or terminate?

Rollback will occur only if the program abends.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Nov 06, 2009 5:25 pm
Reply with quote

Quote:
2. Now my subprogram failed for 2nd record so as per my understanding
1st Inserted record will roll back


what do you mean by failed?

and here are some links about COMMIT

but, based on your quote, your problem is not with the commit,
but your interpretation of failed
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Fri Feb 12, 2010 3:26 pm
Reply with quote

Hi Guys,

Sorry for the late reply..
I have come across similar issue again..

Here I am reading the input file and Inserting record in table and whenever there is a DB2 error I am causing an intensional SOC7 error.

But surprisingly the DB2 records processed prior to Abend not getting roll back and my input file also got deleted. I have kept the disposition as (OLD,DELETE,KEEP) so that when there is an Abend file will be kept..

When I digged more on this I observed that the IKJEFT01 step in which I am processing the records gives a return code of 12. So that that particular step got executed normally but with return code as 12 and it caused file to delete as well as record prior to Abend got processed.

Would anybody help me why IKJEFT01 step giving return code as 12 in case of a DB2 error?

Also Is there a way to return the "real" abend code

Thanks in Advance,

Regards,
Chandan
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Fri Feb 12, 2010 4:13 pm
Reply with quote

Hi All,

I tried to get some more info on this following is the link for the same

billlalonde.tripod.com/stupid.htm

THis is solving my issue by using IKJEFT1A..but still I will be very thankful if I come to know is there any way to get real Abend code using IKJEFT01

Regards,
Chandan
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top