MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Anything wrong with my Delete JCL?!?!?!?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
sakreg
Beginner


Joined: 28 Feb 2005
Posts: 80
Topics: 26

PostPosted: Mon Jun 06, 2005 6:02 am    Post subject: Anything wrong with my Delete JCL?!?!?!? Reply with quote

Hi,

I am trying to Flush Off data from MY_TABLE and also Unload all those data to be purged to a Dataset using the below JCL.

I am getting a SQL CODE -199. I do not see anything wrong in the DELETE SQL. Can you guys find anything wrong in the below JCL. If so plz correct me.
Quote:

***************************** Top of Data ******************************
//XXXXXX0 JOB (XXXX),'TEST DELETE SQL',CLASS=E,
// MSGLEVEL=(2,0),REGION=2M,NOTIFY=XXXXXX,MSGCLASS=T,TIME=(0,30)
//***************************************************************
//* FLUSH OUT ALL THE DATA FROM DB2 TABLE AND WRITE TO A DATASET*
//***************************************************************
//JOBLIB DD DSN=XXXX.DSNLOAD,DISP=SHR
//STEP0100 EXEC PGM=IKJEFT01
//*
//SYSTSPRT DD SYSOUT=*,DCB=BLKSIZE=121
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(XXXX)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) LIB('XXXX.RUNLIB.LOAD')
END
//SYSREC00 DD DSN=XXXXXX.XXXXXX.PURGED,
// DISP=SHR,
// UNIT=SYSDA,
// SPACE=(TRK,(1,2),RLSE)
//SYSPUNCH DD SYSOUT=*
//SYSIN DD *
DELETE FROM MY_TABLE;
/*
**************************** Bottom of Data ****************************

In Short what I want to achieve is to flush off data from the specified DB2 table using JCL. There actually is no need to write to the Dataset also. So if there is any better JCL, please post that also.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jun 06, 2005 7:04 am    Post subject: Reply with quote

Sakreg,

You are missing PARMS statement in your SYSTSIN dd statement.

Code:

//SYSTSIN  DD  *                         
 DSN SYSTEM(xxx)                         
 RUN  PROGRAM(DSNTIAUL) -                 
      PLAN(DSNTIAUL)    -                 
      PARMS('SQL')      -                 
      LIB('XXXX.RUNLIB.LOAD')   


Add that line and your JCL should will run without any problems. However you can also run DSNSTEP2 as shown below.

Code:

//STEP0100 EXEC PGM=IKJEFT01
//SYSTSIN  DD *                             
  DSN SYSTEM(xxx)                         
  RUN PROGRAM(DSNTEP2) -                   
      PLAN(DSNTEP2)    -                   
      LIB('DB2P.RUNLIB.LOAD')               
  END                                       
//*                                         
//SYSTSPRT DD SYSOUT=*                     
//SYSPRINT DD SYSOUT=*                     
//SYSIN    DD *
  DELETE FROM TABLE;
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sakreg
Beginner


Joined: 28 Feb 2005
Posts: 80
Topics: 26

PostPosted: Tue Jun 07, 2005 12:53 am    Post subject: Reply with quote

Yeah that Worked. Thanks for your time.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group