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

how to delete the records from table through JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
snehal

New User


Joined: 12 Dec 2006
Posts: 14
Location: pune

PostPosted: Wed Mar 19, 2008 2:24 pm
Reply with quote

how to delete the records from table through JCL

i.e. In my program I have to do JCL by which I have to delete the data older than 6 months from table .
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 19, 2008 2:32 pm
Reply with quote

as said many times JCL will do nothing in itself..

please clarify better what You want to do..

if... your environment is db2, an/or You are misnaming a file for a table

if .. You have a program and You want to write some code to delete data based on some criteria

if .. You want to run some other program/utility to achieve the result

if...

a good idea would be to lurk and/or search the forum forr similar problems
in order to better explain You requirements
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 19, 2008 4:36 pm
Reply with quote

"how to delete the records from table through JCL"

==> by using DSNTEP2

//STEP0100 EXEC PGM=IKJEFT01
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2R)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2)
//SYSIN DD DATA
DELETE * FROM
S307.IFRS_APE_GKTO_BTAG
WHERE KONTO_ID = '9449-11-14-11.42.49.900705'
;

Regards, UmeySan
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Wed Mar 19, 2008 6:00 pm
Reply with quote

Hi Umeysan

Can you please expain about KONTO_ID
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 19, 2008 6:18 pm
Reply with quote

...just a name of a column in a table, used in this where-clause.

...just the german word for account-number
(...means the number of your bank-account)
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: Wed Mar 19, 2008 9:44 pm
Reply with quote

Hello,

Quote:
In my program I have to do JCL by which I have to delete the data older than 6 months from table .
How are you "doing jcl" "in my program"? If you have a program, why not simply issue the DELETE sql from within the program?

There is obviously something i am misunderstandng. . .
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Mar 19, 2008 9:51 pm
Reply with quote

I think the problem is that he needs the SQL to do the delete for data that is older than 6 months but he doesn't know enought about what he is trying to do to ask the question. Without more information nobody can give him the answer.
Back to top
View user's profile Send private message
snehal

New User


Joined: 12 Dec 2006
Posts: 14
Location: pune

PostPosted: Thu Mar 20, 2008 3:55 pm
Reply with quote

Thanks a lot Umeysan... ur suggested JCL working fine...
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 Mar 20, 2008 9:24 pm
Reply with quote

Hello,

Quote:
ur suggested JCL working fine
What in that jcl has anything to do with "In my program. . ."?

Good to hear that what you want is happenng icon_smile.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts DELETE SPUFI DB2 1
No new posts Load new table with Old unload - DB2 DB2 6
No new posts DSNTIAUL driven delete IBM Tools 0
Search our Forums:

Back to Top