Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 4648
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 6 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us