View previous topic :: View next topic
|
Author |
Message |
brindha christy
New User
Joined: 26 Aug 2008 Posts: 20 Location: India
|
|
|
|
I need a REXX code, which could delete all of the members starting with charector AB in a PDS. The PDS would have many of other members. only the members starting with AB should be deleted.
Is this possible?
Can anyone suggest how? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
brindha christy wrote: |
Is this possible?
Can anyone suggest how? |
- Create a member list.
- Loop through the member list. For any member name where the first two characters are 'AB', issue a TSO DELETE command for the member.
<< OR >>
- Since the dataset is a PDS, IPSF Library Management (LM) Services can be used.
- Use the LMINIT Service to generate the data ID.
- Use the LMOPEN Service to open the data ID for output.
- Use the LMMLIST Service to create a member list.
- Use the LMMDEL Service to delete each member that starts with the characters 'AB'.
- Use the LMCLOSE Service to close the data ID. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
why write rexx for it...
if in ISPF you can use the member list panel and issue :
Code: |
DSLIST ..........
Command ===> S AB * D |
|
|
Back to top |
|
|
brindha christy
New User
Joined: 26 Aug 2008 Posts: 20 Location: India
|
|
|
|
The reason is, i am trying get it as a batch job which i would be scheduling in the flow of the rest of the jobs, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest that however you do this, you back up the dataset first. An extra copy costs less than a lost dataset. . . |
|
Back to top |
|
|
|