Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Override -904 abend

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Override -904 abend
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 30, 2010 1:26 am    Post subject:
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    Post subject: Re: Override -904 abend
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    Post subject: Reply to: Override -904 abend
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 30, 2010 1:36 am    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Thu Sep 30, 2010 1:37 am    Post subject:
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: 578
Location: USA

PostPosted: Thu Sep 30, 2010 1:39 am    Post subject:
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Sep 30, 2010 1:46 am    Post subject:
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    Post subject:
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    Post subject: Reply to: Override -904 abend
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: 1738
Location: Bloomington, IL

PostPosted: Thu Sep 30, 2010 2:09 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Sep 30, 2010 2:12 am    Post subject: Reply to: Override -904 abend
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: 578
Location: USA

PostPosted: Thu Sep 30, 2010 2:19 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts Compiler option for override the exte... muralikrishnan_new COBOL Programming 9 Fri Jul 08, 2016 12:09 pm
No new posts S213-14 ABEND explantion Apurva Mehta JCL & VSAM 5 Thu Jul 07, 2016 10:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us