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

Override -904 abend


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

New User


Joined: 30 Sep 2010
Posts: 3
Location: UK

PostPosted: Thu Sep 30, 2010 1:17 am
Reply with quote

Hi!

Can anyone please suggest how to override -904 abend while running a cobol program which delete the data from database.

Thank you
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: Thu Sep 30, 2010 1:26 am
Reply with quote

Hello and welcome to the forum,

At the top of the page is a link to "IBM Manuals". Down the list are some DB2 Messages and Codes. Look in one of these for the reason for the -904 and proceed from there. I prefer the "DB2/UDB Messages & Codes".

You should be aware that this is a db2 return code, not cobol.

If you find something that is not clear, post what you found and your doubt. Someone will be able to clarify.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Sep 30, 2010 1:29 am
Reply with quote

diptivashishta wrote:
Hi!

Can anyone please suggest how to override -904 abend while running a cobol program which delete the data from database.

Thank you


If the program is abending because of -904 sqlcode then it is because that is the way the program was written.
Back to top
View user's profile Send private message
diptivashishta

New User


Joined: 30 Sep 2010
Posts: 3
Location: UK

PostPosted: Thu Sep 30, 2010 1:31 am
Reply with quote

I know that -904 is resource unavailable abend. I get this abend while running COBOL program which runs a SQL query to delete data from database.I want to know if there is any way i can override this aband to delete the data.

I hope its clear now.
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: Thu Sep 30, 2010 1:36 am
Reply with quote

Hello,

Pause and reflect. . . .

Why would you believe there is a way to delete "things" from something that is not available. . . icon_confused.gif

Of course this cannot be "overridden".

Imagine the nightmare if all programs could violate the internal controls of the database system. . .
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 30, 2010 1:37 am
Reply with quote

Well, no.

First, the -904 is not an abend, it is a SQLCODE denoting an error. I and other senior members of these fora know what you mean despite your misspeaking, but it is a good idea to learn proper terminology.

Now, a -904 SQLCODE has only one basic meaning: the query failed because a resource was not available. What resource and why is was unavailable may vary, of course (but note that there will be other information available to you that explains this), and the situation may range in severity from annoying to disastrous, but it is an error. Pry your tired carcass out of bed, roust out those lazy DBAs and sluggish crisis managers, and fix the problem.

Do not put a Band-Aid® on a festering wound and go back to sleep. The day will come when your company or your client suffers a loss of tens or hundreds of crores because of it, and suddenly all fingers will point at you.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Sep 30, 2010 1:39 am
Reply with quote

diptivashishta,
One way is to code loop for 'n' number of time to perform the same delete sql when you get -904. Of course if resource is not available for longer time, this will abend as well.

Thanks,
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: Thu Sep 30, 2010 1:46 am
Reply with quote

Hello,

One of the (if not the first) things to do is determine which resource is not available and why it is not available.

Many organizations will not permit production code to "loop a while" to see if a more acceptable sqlcode is returned. . . They prevent these thru proper scheduling. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Sep 30, 2010 1:57 am
Reply with quote

sqlcode1 wrote:
diptivashishta,
One way is to code loop for 'n' number of time to perform the same delete sql when you get -904. Of course if resource is not available for longer time, this will abend as well.

Thanks,


you should only do this when, after you have (thru your program code)
interrogated the reason code and the resource.
it makes no sense (actually it is really really stupid) to blindly retry sql
when the error could be something that time will not fix.
such as an index missing or corrupted.

a good example is retrying -911/-913's. one would retry if the sqlstate/reasoncode
indicated that a bind was in process.

SQLCODE1,
most of the time you are right-on with your posts.
this time, you have suggested something that no one should blindly do.
Back to top
View user's profile Send private message
diptivashishta

New User


Joined: 30 Sep 2010
Posts: 3
Location: UK

PostPosted: Thu Sep 30, 2010 1:57 am
Reply with quote

The program is written to delete the data and after deleting 5000 records it gives -904 resource unavailable SQL code. The program has been coded to commit after every 100 records. I have even tried after taking exclusive lock on the table but it still gives this SQL error after deleting some records.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Sep 30, 2010 2:09 am
Reply with quote

Format the error message using DSNTIAR and display it in SYSPRINT. Then, if necessary, corral senpai and/or DBAs to explain the message and correct the situation.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Sep 30, 2010 2:12 am
Reply with quote

Quote:
... gives -904 resource unavailable SQL code ...

You are making everybody waste time...
what is the f(riendly) resource that is not available ?
find out, tell, and after that we can continue the discussion
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Sep 30, 2010 2:19 am
Reply with quote

diptivashishta,

-904 UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE RESOURCE. REASON reason-code, TYPE OF RESOURCE resource-type, AND RESOURCE NAME resource-name

See if this helps --> -904 analysis
Please post your abend message associated with -904.


Thanks,
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 ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts Need to get an DLI abend like U0200 IMS DB/DC 2
Search our Forums:

Back to Top