View previous topic :: View next topic |
Author |
Message |
vani Beginner
Joined: 28 May 2003 Posts: 51 Topics: 30
|
Posted: Fri Aug 29, 2003 8:25 am Post subject: DB2 is inserting records when the job is abending |
|
|
Hi
I have a cobol-db2 program where iam inserting a row into the table and doing a divide by zero abend. Instead of rolling back, DB2 is inserting that row into the table. I have no commit statements in the program.
Is there any options to be set? Please explain how this is possible.
Regards,
Vani |
|
Back to top |
|
 |
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Fri Aug 29, 2003 9:30 am Post subject: |
|
|
Vani,
Are you checking the return code from the SQL statment after execution ?. DB2 does some Rollback for abends like -911, -913 etc. But for most other situations we need to check and issue a Rollback. Most installations have a common abend routine to be performed, like
EVALUATE SQLCODE
WHEN 0
CONTINUE
WHEN OTHER
DISPLAY 'ABEND CODE '
PERFORM Standard error routine
END-EVALUATE. |
|
Back to top |
|
 |
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Fri Aug 29, 2003 9:33 am Post subject: |
|
|
Vani,
A quick follow-up, if the return code(SQLCODE) is not checked and the job ends the database changes will be commited automattically. |
|
Back to top |
|
 |
vani Beginner
Joined: 28 May 2003 Posts: 51 Topics: 30
|
Posted: Sun Aug 31, 2003 11:48 pm Post subject: |
|
|
Thanx,
Even after checking the return code, the job is abending with a return code of 3000 but Roll back is not performed. The record is getting inserted. The SQL code returned when displayed was 00000080L. The Cobol Error suggests that the thread is getting cut but as per the theory, when the thread gets released, DB2 does a roll back till the last commit point, which is not happening.
Regards,
vani |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
|
|