Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DSNTEP2 error in deleting rows from table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: DSNTEP2 error in deleting rows from table
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: 1013
Location: India

PostPosted: Thu Nov 19, 2009 4:16 pm    Post subject:
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

Site Director


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

PostPosted: Thu Nov 19, 2009 9:33 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Nov 20, 2009 10:34 am    Post subject: Reply to: DSNTEP2 error in deleting rows from table
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: 1013
Location: India

PostPosted: Fri Nov 20, 2009 10:50 am    Post subject:
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: 1278
Location: Belgium

PostPosted: Fri Nov 20, 2009 2:34 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us