Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Empty content of dataset without deleting the dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Empty content of dataset without deleting the dataset
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

Moderator Team Head


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

PostPosted: Wed Jun 14, 2006 8:08 pm    Post subject: Re: Empty content of dataset without deleting the dataset
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    Post subject: Re: Empty content of dataset without deleting the dataset
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us