View previous topic :: View next topic
|
Author |
Message |
roykpc
New User
Joined: 27 Nov 2009 Posts: 2 Location: Kolkata
|
|
|
|
Dear All,
I have a situation where I am using DROP command to drop DB2 Objects in a JCL using IKJEFT01.
The problem is -
In some cases, DB2 objects are not present, it gives and SQLCODE of -204 and the JCL abends with RC=8.
Is there any way to Hardcode the JCL RC=0 in IKJEFT01. I am expecting something similar to doing SET 'MAXCC=0' in IDCAMS
--Kingshuk |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am using DROP command to drop DB2 Objects in a JCL using IKJEFT01. |
If you did this in a program, you could control the rc. . . |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
roykpc wrote: |
I am expecting something similar to doing SET 'MAXCC=0' in IDCAMS
|
So why not do just that? Call IDCAMS and provide the SET MAXCC=0 command in a //SYSIN DD statement? |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
I believe DSNTEP2 continues after SQL-errors, just make sure you commit between each drop.
then afterwards set CC with the idcams
edit: I rechecked : apparently no need to commit and maximum 10 failed statements:
Quote: |
First off, you need to know that DSNTEP2 has an internal parameter named MAXERRORS that controls the number of failing statements that can occur before it stops. A failing statement is one which returns a negative SQLCODE. The value of MAXERRORS is set to 10 inside the program, so DSNTEP2 will allow 9 failing SQL statements but when it hits the 10th failing statement, it will exit, COMMITting all other work.
This is ugly because it can wreak havoc on the integrity of your data. I mean, who wants to figure out what was run, what was impacted, and then try to rebuild a job to fix data and/or restart at the right place? To rerun DSNTEP2, remember that all SQL statements that completed with a 0 SQL code were committed. These statements should not be rerun. All SQL statements completed with a negative SQL code must be corrected and reprocessed.
Certain severe errors cause DSNTEP2 to exit immediately. One severe error is a -101 “SQL statement too long or too complex".
If any SQL errors occurred during the execution of DSNTEP2, a return code of 8 is returned by the job step.
At any rate, DSNTEP2 never issues an explicit COMMIT or ROLLBACK by itself. A COMMIT occurs at the end unless the program abends. |
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Maybe you can use :
EXIT CODE(0) |
|
Back to top |
|
|
|