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

To display only lines containing a particular word


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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: 1702
Location: Australia

PostPosted: Fri Aug 01, 2008 10:17 am
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

Superior Member


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

PostPosted: Fri Aug 01, 2008 10:43 am
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
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 13, 2008 7:57 pm
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

Global Moderator


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

PostPosted: Wed Aug 13, 2008 9:20 pm
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

Moderator Emeritus


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

PostPosted: Thu Aug 14, 2008 1:58 am
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: 1020
Location: India

PostPosted: Thu Aug 14, 2008 10:55 am
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
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

Superior Member


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

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

Hi maridawson,

I see some similarties between this & this 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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts I need a 4 lines block where substrin... DFSORT/ICETOOL 12
No new posts Copy few lines from SYSOUT of 10 mill... All Other Mainframe Topics 5
Search our Forums:

Back to Top