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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm

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