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

Delete/erase contents of a dataset or PDS using JCL


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

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Fri Apr 17, 2009 11:13 am
Reply with quote

Hi!
Is it possible to delete/erase the contents of a data set or PDS using JCL without actually deleting the data set.?

For e.g.,

Say a data set 'qwerty.asdfg.zxcv' contains
*****Top of the Data*****
11111
22222
33333
***Bottom of the Data****

Is it possible to delete
11111
22222
33333

so that the data set looks like
*****Top of the Data*****
***Bottom of the Data****
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Apr 17, 2009 11:30 am
Reply with quote

Hi,

There are many ways - you may use something like this:
Code:
//JS00100  EXEC PGM=IDCAMS                               
//DDDMMY   DD DUMMY                                     
//DDOUT    DD DSN=...input file
//            DISP=SHR                                   
//SYSIN    DD *                                         
  REPRO IFILE(DDDMMY) OFILE(DDOUT)                       
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//*                                                     
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Apr 17, 2009 11:34 am
Reply with quote

Please take the back-up of input file first - not sure how important data do you have in that; or run a test on some test data if satisfied do whatever you want with your file.
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Fri Apr 17, 2009 12:27 pm
Reply with quote

Anuj, it worked.
Thanks for the reply.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Apr 17, 2009 3:55 pm
Reply with quote

Hopefully, I was helpful . . . icon_smile.gif

Ad
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Apr 17, 2009 4:19 pm
Reply with quote

This topic shows a few different methods for emptying a sequential dataset.

This topic shows a few different methods for emptying a PDS.
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Fri Apr 17, 2009 4:23 pm
Reply with quote

Thanks Superk, for the information
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top