Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To display only lines containing a particular word

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Fri Aug 01, 2008 10:10 am    Post subject: To display only lines containing a particular word
Reply with quote

How to display only lines containing a particular word using TSO/ISPF option?
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Aug 01, 2008 10:17 am    Post subject:
Reply with quote

Hi,

if I understood your request correctly and assuming you are in edit mode,

Code:
X ALL
F WORD ALL
DELETE X ALL



Gerry
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Aug 01, 2008 10:43 am    Post subject:
Reply with quote

One more thought-
Code:
F ALL 'PARTICULAR WORD'
& yup as Gerry said either in Edit (or view) mode.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 01, 2008 11:03 am    Post subject:
Reply with quote

Stole an edit macro years ago from IBM: I call it INCL (include)

Code:

/* REXX */
ADDRESS ISREDIT
'MACRO (TARGET)'
X ALL
FIND ALL TARGET
EXIT
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Wed Aug 13, 2008 7:53 pm    Post subject:
Reply with quote

In the below PS file, all 'infy' in the lines with string 'ABC' are changed to 'bofa'.

Initial:

000001 ABC000infy
000002 ABC222infy
000003 AAA000infy
000004 CCC000infy
000005 ABC333infy


After command:

000001 ABC000bofa
000002 ABC222bofa
000003 AAA000infy
000004 CCC000infy
000005 ABC333bofa

Tell me the single line command to change above data to look like below one?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Wed Aug 13, 2008 7:57 pm    Post subject:
Reply with quote

Code:
X ALL;F 1 3 'ABC' ALL;C 'infy' 'bofa' NX ALL
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2025
Location: Silicon Valley

PostPosted: Wed Aug 13, 2008 9:20 pm    Post subject: Reply to: To display only lines containing a particular word
Reply with quote

Quote:
Tell me the single line command to ...

It is worth noting that not all complex changes can be done with a single line command. Some changes may take a few commands.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Aug 14, 2008 1:58 am    Post subject:
Reply with quote

Hello,

Also, keep in mind that when you show only a tiny bit of input/output data and do not describe the "rules", code that works for the sample data may not work for other cases.

Stringing multiple commands on one command line is still multiple commands. . . .
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Aug 14, 2008 10:55 am    Post subject:
Reply with quote

Mari,
Question :
Quote:
How to display only lines containing a particular word using TSO/ISPF option?

Input Data :
Code:
000001 ABC000infy
000002 ABC222infy
000003 AAA000infy
000004 CCC000infy
000005 ABC333infy

Answer : show 8 10 'abc'
Syntax : show columnstart columnend textstringwithinquotes

Question :
Quote:
In the below PS file, all 'infy' in the lines with string 'ABC' are changed to 'bofa'.
Tell me the single line command to change above data to look like below one?

Answer :
Thank You Robert sample u have done most of the work.
Command for your input for the result output.<br>
X ALL;F 8 10 'ABC' ALL;C 'infy' 'bofa' NX ALL

Above command is not a single line command. It is multiple, and can be entered in a single line. ';'
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Thu Aug 14, 2008 11:44 am    Post subject: Reply to: To display only lines containing a particular word
Reply with quote

Quote:
Tell me the single line command to change ...


If you want to do the changes in a single line command, you can also try the below.

C ALL P'ABC===INFY' P'ABC===BOFA'
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Aug 14, 2008 11:46 am    Post subject:
Reply with quote

Hi maridawson,

I see some similarties between this & this http://www.ibmmainframes.com/viewtopic.php?t=33358&highlight= thread.. icon_smile.gif
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us