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

Empty content of dataset without deleting the dataset


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

New User


Joined: 26 Mar 2005
Posts: 17

PostPosted: Wed Jun 14, 2006 8:02 pm
Reply with quote

Hello.

Is there a way, to empty the contents of a physical sequential dataset, without deleting the dataset itself...?

Thanks for your help and attention.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Jun 14, 2006 8:08 pm
Reply with quote

A simple SORT will work:

Code:

//STEP0001 EXEC PGM=SORT                           
//SORTIN   DD   DISP=SHR,DSN=THE.DATASET
//SORTOUT  DD   DISP=SHR,DSN=THE.DATASET
//SYSOUT   DD   SYSOUT=*                           
//SYSIN    DD   *                                   
  OPTION COPY                                       
  OMIT COND=ALL                                     
/*                                                 


A one-line REXX exec will also do the same thing:

Code:

/* REXX */
"EXECIO 0 DISKW DDNAME (FINIS"


There are also other methods, such as copying the contents of an empty dataset. You'll find these other examples with a search.
Back to top
View user's profile Send private message
mail_ssb

New User


Joined: 26 Mar 2005
Posts: 17

PostPosted: Wed Jun 14, 2006 8:17 pm
Reply with quote

superk wrote:
A simple SORT will work:

Code:

//STEP0001 EXEC PGM=SORT                           
//SORTIN   DD   DISP=SHR,DSN=THE.DATASET
//SORTOUT  DD   DISP=SHR,DSN=THE.DATASET
//SYSOUT   DD   SYSOUT=*                           
//SYSIN    DD   *                                   
  OPTION COPY                                       
  OMIT COND=ALL                                     
/*                                                 


A one-line REXX exec will also do the same thing:

Code:

/* REXX */
"EXECIO 0 DISKW DDNAME (FINIS"


There are also other methods, such as copying the contents of an empty dataset. You'll find these other examples with a search.


Thanks a ton, Superk..!

I like the SORT option better, because then, I dont need to worry about the dataset features like record length and dataset type.
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 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
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Deleting a Tape file JCL & VSAM 14
Search our Forums:

Back to Top