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
 
Command to delete all the lines with specific string.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Jun 15, 2006 5:00 pm    Post subject: Command to delete all the lines with specific string.
Reply with quote

Hi,

My requirement is to select all the lines in a member with a particular string andl delete all the lines with single command.

Could anyone let me know the command. I remember there is a command for that. But couldn't recollect.

~Vamsi
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Thu Jun 15, 2006 5:14 pm    Post subject: Re: Command to delete all the lines with specific string.
Reply with quote

Well, if it were me, and if I was editing the member in an ISPF EDIT session, I would first exclude all of the records containg the string:

X 'STRING' ALL

then I would delete all of the excluded records:

DEL X ALL

then I would save the edited data:

SAVE
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Jun 15, 2006 7:18 pm    Post subject:
Reply with quote

superk,

What is the basic difference between DEL all X and DEL all NX

~Vamsi
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Thu Jun 15, 2006 7:19 pm    Post subject: Re: Command to delete all the lines with specific string.
Reply with quote

One is DELETE ALL EXCLUDED.

The other is DELETE ALL NON-EXCLUDED.

They are inverse operations of each other.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Jun 26, 2006 12:57 am    Post subject:
Reply with quote

Adding to what K suggested, you might want to enter "flip" (no quotes) on the cmd line after issuing the "X 'STRING' ALL".

This will allow you to see what you're deleting before you do. Many times you get more (or less) than you bargained for. You can also get the same result with:

x all;f all 'string'

If you're satisfied, then enter del all nx.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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