View previous topic :: View next topic
|
Author |
Message |
Swetha Kunala
New User
Joined: 01 Sep 2006 Posts: 4
|
|
|
|
Hi,
I need to delete some 100 datasets which are of the format
PNF.XX.ABC01,PNF.XX.ABC02 etc til PNF.XX.ABC1000.
COuld you please let me know how i can delete them at once using the IDCAMS utility ?
I also want to recreate these 1000 datasets.
How can this be done ?
Thanks,
Swetha |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You can't easily do this using IDCAMS because the wildcard can only be used for a complete dsn level.
If ABC1000 is DEFINITELY the last one then you can use the wildcard, but if there are more after ABC1000 you can't. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
I need to delete some 100 datasets which are of the format
PNF.XX.ABC01,PNF.XX.ABC02 etc til PNF.XX.ABC1000.
COuld you please let me know how i can delete them at once using the IDCAMS utility ?
I also want to recreate these 1000 datasets.
How can this be done ? |
Just a suggestion..
If these are not VSAM files, you should use GDGs for such datasets, it will be pretty easy to manage them. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If these files are NOT VSAM, then here's a cutie that works. Rather than delete and redefine them again, I just null the files.
Code: |
/* REXX *** RESET DSN RATHER THAN DELETE DEFINE */
"FREE FI(SYSIN,SYSUT1,SYSUT2)"
"ALLOC FI(SYSIN) DUMMY"
"ALLOC FI(SYSUT1) DUMMY"
"EXECIO * DISKR DELETES ( STEM DELS. FINIS"
DO A = 1 TO DELS.0
DSN = STRIP(SUBSTR(DELS.A,1,44))
"FREE FI(SYSUT2)"
"ALLOC FI(SYSUT2) DA('"DSN"') SHR"
"IEBGENER"
END
"FREE FI(SYSIN,SYSUT1,SYSUT2)"
|
It's run in batch with the DELETES DD * having a list of the datasets to be nulled. |
|
Back to top |
|
|
|