View previous topic :: View next topic
|
Author |
Message |
mail_ssb
New User
Joined: 26 Mar 2005 Posts: 17
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
mail_ssb
New User
Joined: 26 Mar 2005 Posts: 17
|
|
|
|
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 |
|
|
|