View previous topic :: View next topic
|
Author |
Message |
santosh_g
New User
Joined: 14 Aug 2011 Posts: 24 Location: india
|
|
|
|
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 |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
|
Back to top |
|
|
sureshpathi10
Active User
Joined: 03 May 2010 Posts: 154 Location: Kuala Lumpur
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
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 |
|
|
|