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

DSNTEP2 error in deleting rows from table


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

New User


Joined: 17 Jul 2007
Posts: 41
Location: pune

PostPosted: Thu Nov 19, 2009 2:33 pm
Reply with quote

Hi,

i'm trying to delete the records in table through JCL using DSNTEP2 utility,
following is the code

//PASO040 EXEC PGM=IKJEFT01,DYNAMNBR=20,TIME=30
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//ABENDAID DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DBAI)
RUN PROGRAM(DSNTEP2) PLAN(DSNTIB81) -
LIB('DSN810AI.RUNLIB.LOAD')
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
DELETE FROM Tablename ;

this code is executed with return code 8, however there is no error displayed. all i'm getting in SYSPRINT is "RESULT OF SQL STATEMENT:"

could someone help me to understand why the records are not getting deleted and why i'm getting return code 8.

Thanks in Advance,
Srinath
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Nov 19, 2009 4:16 pm
Reply with quote

Srinath,

For me this works
Code:
 //TEPPY   EXEC PGM=IKJEFT01           
 //SYSTSPRT DD  SYSOUT=*                 
 //SYSTSIN  DD  *                       
   DSN SYSTEM(DB2D)                     
   RUN  PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
        LIB('DB2.POPR.PROD.RUNLIB.LOAD')
 /*                                     
 //SYSPRINT DD  SYSOUT=*                 
 //SYSUDUMP DD  SYSOUT=*                 
 //SYSIN    DD  *                       
 DELETE FROM BOBT1.TRY1;                 



Thank You,
Sushanth
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Nov 19, 2009 9:33 pm
Reply with quote

Hello,

Quote:
this code is executed with return code 8, however there is no error displayed. all i'm getting in SYSPRINT is "RESULT OF SQL STATEMENT:"
I suspect there is a non-zero sqlcode somewhere. A guess might be a -204. . .
Back to top
View user's profile Send private message
srinathds83

New User


Joined: 17 Jul 2007
Posts: 41
Location: pune

PostPosted: Fri Nov 20, 2009 10:23 am
Reply with quote

Hi Sushanth & Dick Scherrer,

Thanks for you response!!!

i've even tried what Sushanth has mentioned but it was not working. But the problem was with the plan name. the following code workes for me.

//PASO040 EXEC PGM=IKJEFT01,DYNAMNBR=20,TIME=30
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//ABENDAID DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DBAI)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP81) -
LIB('DSN810AI.RUNLIB.LOAD')
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
DELETE
FROM Tablename;

Thanks
Srinath D
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Nov 20, 2009 10:34 am
Reply with quote

You're welcome - thanks for posting the solution icon_smile.gif

d
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Nov 20, 2009 10:50 am
Reply with quote

Great. Srinath, you have resolved it.

Just a a little suggestion. Since you are planning on deleting an entire table using DSNTEP2. You can also do it by doing a DUMMY LOAD, which will perform better & less logging.

Thank You,
Sushanth
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Nov 20, 2009 2:34 pm
Reply with quote

sushanth bobby wrote:
Great. Srinath, you have resolved it.

Just a a little suggestion. Since you are planning on deleting an entire table using DSNTEP2. You can also do it by doing a DUMMY LOAD, which will perform better & less logging.

Thank You,
Sushanth

only for single table tablespaces,
only for tables without delete cascade, delete triggers
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 Error to read log with rexx CLIST & REXX 11
No new posts Load new table with Old unload - DB2 DB2 6
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Error when install DB2 DB2 2
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top