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

Job Fails due to SQL Code -911.. Restart leads to -803


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

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Fri Dec 12, 2008 9:59 am
Reply with quote

Hi

A program fails with -911 during a FETCH statement for a cursor.... It fetches around 30000 records properly and then -911 occurs... And i guess, those 30000 records will be inserted into another table...

The program is coded with restart logic, so that when restarting, in the next run it will ignore those inserted records in the previous run... But restaring again fails with -803..

I am not sure if something needs to be done to avoid -803, but can this -911 be handled? Can we check for -911 after the fetch statement and do somthing to have the deadlock fixed?

Suggestions please...
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 Dec 12, 2008 10:45 am
Reply with quote

Hello,

It may be that the -803 is caused because the restart logic is incorrect. If this is true, the code needs to be corrected regardless of the -911 situation.

This from IBM on the 911 error:
Quote:
-911 THE CURRENT UNIT OF WORK HAS BEEN ROLLED BACK DUE TO DEADLOCK OR
TIMEOUT. REASON reason-code, TYPE OF RESOURCE resource-type, AND
RESOURCE NAME resource-name
Have you identified the reason-code, resouse-type, and resource-name from the problem sql statement?

More complee information on the -911 is available here:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnmc0f7/2.1.7.322?
Back to top
View user's profile Send private message
muhammad

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Fri Dec 12, 2008 11:10 am
Reply with quote

Yes... I have identified the reason code, type, resource name...

What should I do with that?
Back to top
View user's profile Send private message
muhammad

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Fri Dec 12, 2008 11:13 am
Reply with quote

reason code 00C90097

resource type 210
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Dec 12, 2008 11:22 am
Reply with quote

Dulicate Index?
Rebuild?
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 Dec 12, 2008 11:33 am
Reply with quote

Hello,

Quote:
Dulicate Index?
I believe this is the cause of the -803. The restart tries to inseret rows that have already been inserted (which is why i believe the restart logic needs work).

Look here for more on the 00C90097:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnmc0f7/4.8.30?
Back to top
View user's profile Send private message
muhammad

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Fri Dec 12, 2008 12:33 pm
Reply with quote

yes.. issue with restart logic... i have found a fix to avoid -803...

but is there a way to handle -911???
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Fri Dec 12, 2008 1:10 pm
Reply with quote

Quote:
but is there a way to handle -911???


Handled via the program : trap the SQLCODE and act with retries ... to a certain point.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Dec 12, 2008 6:36 pm
Reply with quote

Muhammad,

-911, DEADLOCK or TIMEOUT.

if you are fetching data from one table(SELECT) & inserting into another table(INSERT). you can fetch the data using WITH UR; because the data you are trying to fetch, someone else is using it.

If the data is critical don't use WITH UR, reduce the number of fetches.

Sushanth
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top