MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Simulate DB2 abend

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
arungr
Beginner


Joined: 12 Feb 2005
Posts: 16
Topics: 4

PostPosted: Thu Sep 28, 2006 4:40 am    Post subject: Simulate DB2 abend Reply with quote

Many times for the purpose of Testing, I need to simulate DB2 abends,i.e SQLCODE should be other than 0 or 100. I used to do it through Xpeditor. Is there any simple way by which I can simulate some abend through JCL?

Thanks,
Arun.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Sep 28, 2006 5:32 am    Post subject: Reply with quote

arungr,

NO.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Thu Sep 28, 2006 5:37 am    Post subject: Reply with quote

arungr,

I cann't provide a spcial way for xpeditor or through jcl.

But go to TSO, Db2I, DB2 Commands and do something like "START DATABASE ACCESS = UT". Tablespace is now only available for unilitys, applicationprograms get returncode "resource unavailable".

But you must have at minumum db admin permission.

regards,
bauer
Back to top
View user's profile Send private message
sriramla
Beginner


Joined: 22 Feb 2003
Posts: 74
Topics: 1

PostPosted: Thu Sep 28, 2006 7:49 am    Post subject: Reply with quote

One other option is to keep the table open in edit mode (using Platinum or any other tool) and then run your program. Program will get -911 / -913 as sqlcodes with timeout as the reason code.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Sep 28, 2006 8:06 am    Post subject: Reply with quote

bauer/sriramla,

I did not see anywhere arungr mentioned any thing about checking for unavailable resource. There are many other codes to test (some of the common programatic sql codes such as

-180 or -181 for date fields
-305 for nulls
-501 unopened cursor
-803 for duplicate on index
-805 bind
-818 timestamp mismatch
...

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Thu Sep 28, 2006 8:26 am    Post subject: Reply with quote

kolusu,

my understanding of the question was: How to get SQL codes other than 0 or + 100 to test the program, see "DB2 ABEND" in the post of arungr, means test the errorhandling??!!

So my proposel was, to "simulate" an unavialable resource to get an negative sql code.

But you are right, the codes you mentioned should be tested also.

This codes of course cann't be produced by making a table space unavailable.

Isnn't -180 depeding on the data, -501 depends on logical errors, -805, -818 depends on erros preparing the program?

So modify the data to get -180, make a package invalid to -805 ......
Back to top
View user's profile Send private message
arungr
Beginner


Joined: 12 Feb 2005
Posts: 16
Topics: 4

PostPosted: Sat Sep 30, 2006 9:17 pm    Post subject: Reply with quote

All,
Thanks for the reply. My requirement was, since I am developing new programs, I need to check whether the error handling is working correctly or not. So I want to know of any common method by which I can bring DB2 abend after executing any SQL query.

I have tried the solutions offered but have the following questions. Abends related to Date can not always be brought if is only Select query. Reg.
-805, it works only for the very first query in a program and abends there itself.

I am not able to get the Resource unavailable condition by keeping the table in Edit mode(I am using PST as the Tool).

Thanks,
Arun.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group