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
 

 

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: 8593
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. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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