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 code to delete dataset

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

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Mon Feb 17, 2014 10:27 am    Post subject: Rexx code to delete dataset
Reply with quote

Hi All,

I need some help with rexx code which would delete a dataset based on HLQ. I have to reprot out datasets which the program attempted to delete it and was not successful. In the report I have to reason out why it was not deleted.

Is there a way to find out the reason why dataset was not deleted (Retrun code ??).
Back to top
View user's profile Send private message

TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Mon Feb 17, 2014 11:17 am    Post subject:
Reply with quote

Santosh,

You can use LMDLIST function to list dataset names based on HLQ. Alternatively you can use "LISTCAT LVL" to list datasets based on HLQ.
Use DELETE to delete a dataset using REXX and if you want to capture if dataset is deleted or not(with error message), you can use OUTTRAP on DELETE statement.

Hope this helps icon_smile.gif
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Mon Feb 17, 2014 11:18 am    Post subject:
Reply with quote

1. Use LISTCAT to gather list of dataset based on HLQ. Use OUTTRAP function.
2. TSO DEL command to delete one by one (include business conditions before delete)
3. You can always get 'RC' from REXX.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Mon Feb 17, 2014 1:06 pm    Post subject: Reply to: Rexx code to delete dataset
Reply with quote

the issue has been discussed quite a few times
and the general consensus is not to waste time reinventing the wheel ...

and use IDCAMS for a qualifier only approach
or use DFDSS to filer on additional criteria ( for example reference date )

search the forum with "DFDSS DELETE"
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
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm


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