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

Set RC=0 in IKJEFT01 while DROPing DB2 Objects


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
roykpc

New User


Joined: 27 Nov 2009
Posts: 2
Location: Kolkata

PostPosted: Wed Sep 08, 2010 2:27 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Sep 08, 2010 3:00 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Sep 08, 2010 5:12 am
Reply with quote

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
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Sep 08, 2010 1:12 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Sep 08, 2010 1:48 pm
Reply with quote

Maybe you can use :

EXIT CODE(0)
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts De-compile AFP objects IBM Tools 1
No new posts Updating DFSMShsm DB when objects are... JCL & VSAM 0
No new posts COBOL D2 program execution without us... DB2 3
No new posts IKJEFT01 DB2 3
Search our Forums:

Back to Top