Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Rexx Program to delete datasets

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Naresh chinthaneppu

New User


Joined: 21 Jun 2007
Posts: 11
Location: pune

PostPosted: Wed Aug 22, 2007 1:56 pm    Post subject: Rexx Program to delete datasets
Reply with quote

Hi,

i want to delete all the datasets starting with some string CHIRU.there are 1500 datasets starting with CHIRU.i can not do it manually typing D against each dataset.

similerway i want to delete all datasets of the format NAGA*.AB001234.*
Back to top
View user's profile Send private message

jobin

New User


Joined: 20 Feb 2007
Posts: 9
Location: Bangalore

PostPosted: Wed Aug 22, 2007 2:15 pm    Post subject:
Reply with quote

List all the datasets starting with CHIRU using
"LISTC LEVEL('CHIRU')" into an array.

Regarding the getting specific pattern do a sort on the list. Have a look at <a href="http://ibmmainframes.com/viewtopic.php?t=611&highlight=list+datasets+starting">this post </a>

Loop through the array and perform "TSO" "DLETE '"FILE_NAME"'" for each datasets.
Back to top
View user's profile Send private message
Maverick34

New User


Joined: 19 Aug 2007
Posts: 4
Location: UK

PostPosted: Wed Aug 22, 2007 2:24 pm    Post subject:
Reply with quote

why not use DF/dss to do this?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

PostPosted: Wed Aug 22, 2007 2:55 pm    Post subject:
Reply with quote

Unfortunately Dfdss does not cater for tape or migrated datasets
Back to top
View user's profile Send private message
jobin

New User


Joined: 20 Feb 2007
Posts: 9
Location: Bangalore

PostPosted: Wed Aug 22, 2007 4:50 pm    Post subject:
Reply with quote

Try this following one

Code:
/* rexx */
/* list all the datasets starting with nbdlzsa in filel. array */
j = 0
k = 0
x = outtrap(mbrs.)
"LISTC LEVEL('NBDLZSA')"
do i = 1 to mbrs.0
   if pos('IN-CAT',mbrs.i) > 0 then nop
   else do
      parse var mbrs.i . '-------' mbrs.i
      mbrs.i = strip(mbrs.i)
      j = j + 1
      filel.j = mbrs.i
   end
end
/* say you want to have only datasets nbdlzsa.*.AR.* to be deleted */
do i = 1 to j
   parse var filel.i . '.' . 'AR.' rest
   if rest <> '' then do
      k = k + 1
      finall.k = filel.i
   end
end
/* delete the files listed in finall. array */
do i = 1 to k
    "delete '"finall.i"'"
end
exit


Hope it helps
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Aug 22, 2007 5:25 pm    Post subject: Reply to: Rexx Program to delete datasets
Reply with quote

Just use the TSO command DEL to delete the datasets. It works fine in my shop.

TSO DEL 'HLQ.ARU.DATAST.*'
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. GDG gen check using REXX raghuraman123 CLIST & REXX 6 Wed Apr 18, 2018 9:18 pm
No new posts How do you attach a DB2 plan to a CIC... John Poulakos DB2 0 Wed Apr 18, 2018 1:49 am
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts Mantis Program Compiled? luis carlos CICS 2 Sat Apr 07, 2018 8:59 pm
This topic is locked: you cannot edit posts or make replies. Unavailable RECON datasets while exec... abdulrafi JCL & VSAM 10 Fri Apr 06, 2018 12:45 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us