IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reg: Deletion and creation of 1000 datasets


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Swetha Kunala

New User


Joined: 01 Sep 2006
Posts: 4

PostPosted: Fri Apr 13, 2007 5:35 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Apr 13, 2007 6:11 pm
Reply with quote

See if below link helps.. icon_smile.gif
http://ibmmainframes.com/viewtopic.php?t=6069&highlight=adrdssu
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Apr 13, 2007 6:12 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Apr 13, 2007 6:16 pm
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Apr 13, 2007 7:06 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts JCL sort card for file creation condi... DFSORT/ICETOOL 4
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts VSAM KSDS CREATION AND LOAD WITH RAND... JCL & VSAM 1
Search our Forums:

Back to Top