IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX code to delete some of the members in a PDS


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
brindha christy

New User


Joined: 26 Aug 2008
Posts: 20
Location: India

PostPosted: Wed Nov 19, 2008 10:38 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Nov 19, 2008 10:57 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Nov 19, 2008 11:21 am
Reply with quote

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
View user's profile Send private message
brindha christy

New User


Joined: 26 Aug 2008
Posts: 20
Location: India

PostPosted: Wed Nov 19, 2008 11:56 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 19, 2008 8:45 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts DELETE SPUFI DB2 1
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts DSNTIAUL driven delete IBM Tools 0
Search our Forums:

Back to Top