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 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
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
This topic is locked: you cannot edit posts or make replies. Get and display content of an address... lind sh CICS 1 Mon Aug 08, 2016 9:18 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm


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