View previous topic :: View next topic
|
Author |
Message |
srinathds83
New User
Joined: 17 Jul 2007 Posts: 41 Location: pune
|
|
|
|
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 |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
srinathds83
New User
Joined: 17 Jul 2007 Posts: 41 Location: pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - thanks for posting the solution
d |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
|