View previous topic :: View next topic
|
Author |
Message |
keerthi
New User
Joined: 23 Mar 2005 Posts: 25
|
|
|
|
I faced this question in an interview. Please let me know if anybody knows the answer.
Without deleting the dataset i want to delete only the records from the dataset using JCL.
Thanks in advance |
|
Back to top |
|
|
alamelu
New User
Joined: 18 Jul 2005 Posts: 15
|
|
|
|
you can acheive this by using the utility ZEMPTY(if your mainframe supportes the utility)
you need to code ur jcl like this
//step1 exec pgm=zempty
//z1 dd dsn=dataset name,disp=shr
this will delete all the records in the provided dataset
Hope this helps u............ |
|
Back to top |
|
|
raghavendraun
New User
Joined: 29 Apr 2005 Posts: 9
|
|
|
|
Hi keerthi,
Here is another Example,
//STEP01 exec pgm=iebgener
//sysprint dd sysout=*
//sysut1 dd dummy,
// dcb=(blksize=800,lrecl=80, recfm=fb)
//sysut2 dd dsb=Your-Dataset,
// disp=shr
//sysin dd dummy
Regards,
Raghavendra U N |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Using SORT:
Code: |
//STEP0001 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=MY.DATASET
//SORTOUT DD DISP=SHR,DSN=MY.DATASET
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=ALL
//*
|
|
|
Back to top |
|
|
EnjoyMF
New User
Joined: 27 May 2005 Posts: 88
|
|
|
|
Hi friend
use
repro indataset(dataset1) outdataset(dataset2)
dataset1--------empty dataset
so after repro dataset2 will also be empty
Regards
prasad |
|
Back to top |
|
|
|