View previous topic :: View next topic |
Author |
Message |
arungr Beginner
Joined: 12 Feb 2005 Posts: 16 Topics: 4
|
Posted: Thu Sep 28, 2006 4:40 am Post subject: Simulate DB2 abend |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
bauer Intermediate
Joined: 10 Oct 2003 Posts: 317 Topics: 50 Location: Germany
|
Posted: Thu Sep 28, 2006 5:37 am Post subject: |
|
|
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 |
|
 |
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Thu Sep 28, 2006 7:49 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Sep 28, 2006 8:06 am Post subject: |
|
|
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 |
|
 |
bauer Intermediate
Joined: 10 Oct 2003 Posts: 317 Topics: 50 Location: Germany
|
Posted: Thu Sep 28, 2006 8:26 am Post subject: |
|
|
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 |
|
 |
arungr Beginner
Joined: 12 Feb 2005 Posts: 16 Topics: 4
|
Posted: Sat Sep 30, 2006 9:17 pm Post subject: |
|
|
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 |
|
 |
|
|