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 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

Senior Member


Joined: 14 Mar 2007
Posts: 10492
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 Invoke WebService failing with respon... Ashishpanpaliya CICS 1 Thu Aug 09, 2018 3:14 pm
This topic is locked: you cannot edit posts or make replies. IO-PCB status code AL srinianusuya IMS DB/DC 1 Mon Aug 06, 2018 10:26 am
No new posts Can we call QMF proc from REXX ? batu544 CLIST & REXX 6 Fri Aug 03, 2018 11:03 am
No new posts SQL Code 302 while executing stored ... Ashishpanpaliya DB2 8 Wed Aug 01, 2018 7:54 pm
No new posts sql code 331 while calling Stored Pro... Ashishpanpaliya DB2 5 Wed Aug 01, 2018 7:06 pm

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