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

How to search a string which is with in single quotes??


IBM Mainframe Forums -> TSO/ISPF
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
yogi.47eie

New User


Joined: 16 Aug 2006
Posts: 45
Location: india

PostPosted: Mon Jul 28, 2008 7:06 pm
Reply with quote

Hi all,
I am trying to serach a string which is with in single quotes..
using SRCHFOR i couln't find ?
In 3.14 also not able to do...
string that i need to find is like 'yogi' - note that yogi is with in single quote.....
since i am not that much familiar with Rexx i couln't write any routine ..
can any one of you share the solution for me??

Thanks
Yogi
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jul 28, 2008 7:16 pm
Reply with quote

There are general rules for searching or dealing with quoted strings.

What have you tried to do so far and what results did you get
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jul 29, 2008 1:01 am
Reply with quote

and by the way, SUPERC and 3.14 are the same...

O.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 12:03 pm
Reply with quote

Yogi,

Did you try the FIND command?

Code:
F ''string''
Back to top
View user's profile Send private message
yogi.47eie

New User


Joined: 16 Aug 2006
Posts: 45
Location: india

PostPosted: Tue Jul 29, 2008 5:50 pm
Reply with quote

Hi all,
I am going to search the string not with in a single member.It is with in a PDS which is having more than 200 members.
I have tried the srchfor with below options
SRCHFOR ''YOGI'' - error was Null string invalid
SRCHFOR "'YOGI'" - error was Invalid embedded quote
SRCHFOR '"YOGI'" - error was Invalid search-string

we cannot give F ''YOGI'' when we are searching with in a PDS.If its a signle member we can give.

Thanks
Yogi
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jul 29, 2008 6:03 pm
Reply with quote

There is an example for your exact problem in the fine manual.

O.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jul 29, 2008 6:05 pm
Reply with quote

1) What about sorting for a non quoted string. i.e. Find all occurances and eye scan to deleted non quoted strings.

2) Keep going using 3.14 / SUPERC, keep adding those single quotes to back and front of the search string, and you WILL get there.
Back to top
View user's profile Send private message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 25
Location: Calgary, AB

PostPosted: Tue Jul 29, 2008 6:19 pm
Reply with quote

I kind of agree with expat solution.

You can search on the string YOGI using 3.14, then after getting the results, issue the following command.
x all;f all "'YOGI'"

then issue the following command placing the cursor on the bottom most result you found. This will give you the member names.
f p'>' 3 prev

then issue the following command
delete all x

You should have the result you need now.

remember that you should be having the option to view the results instead of browse to issue the above commands.
Back to top
View user's profile Send private message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 25
Location: Calgary, AB

PostPosted: Tue Jul 29, 2008 6:22 pm
Reply with quote

Sorry. I should have been more clear. For the 3rd statement, you should continue to do the same placing the cursor on each line you found the result "'YOGI'". Doing it once will give you the last member name only where the string was found.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Jul 29, 2008 8:40 pm
Reply with quote

Please use BBCode so it's easier to distinguish between single and double quotes and the spacing between them.
Back to top
View user's profile Send private message
yogi.47eie

New User


Joined: 16 Aug 2006
Posts: 45
Location: india

PostPosted: Wed Jul 30, 2008 12:31 am
Reply with quote

Hi all,
Thanks for the response

Ofer71 ,,,
i have referred the manual that you referred
Example Search strings: Explanation:
===> 'AB C''D' The string (AB C'D) is specified.


from where i got an rough idea of searching a string which is having a single quote
(not with in single quote,but the string which is having a single quote)

Here D is preceded by a single quote & srchfor has given with D preceded by one single quote


i couldnt get the logic behind the way srchfor is issued,
but this reference gave me an idea of searching a string in different manner but with
out any logic..
Yes i gave a search as below
SRCHFOR '''YOGI'
ITS GIVING THE RESULTANT MEMBERS AS I EXPECTED.

i couldn't get the exact logic behind this one...
but still i have tried randomly the string which i am searching for is having the two single quotes

the concerned string was with in two single quotes & i gave a search preceded by the two single quotes
it gave me the result as i expected..

better if we give srchfor the below string also with different manner & update this forum it will be useful
currently i coulnt do that one from here....
will try all the options and update this forum...
if anyone is able to find any other logic behind this kind of search let us know the same...
XPAT,
thanks to XPAT ALSO who gave me an idea to give random search with single quotes preceded by &
followed by the string...
i will try the sort step to find the string which also making sense to me...


Neeraja,
x all;f all "'YOGI'"
for me when i gave the search its giving around 50 members & for each member issuing the command
which is some more painful.if we have less than 10 members then we can use as per the steps you have suggested..
we can use this one after opening a single memebr of PDS od single PS files.


Request everyone to try the same & make sure this is not system specific & it can be used in any system..

Hendry
i am not that much clear with whatever you have stated.. can you share your views also....

Thanks
Yogi
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Jul 30, 2008 12:37 am
Reply with quote

Yogi,
Please use BBCode so it's easier to distinguish between single and double quotes and the spacing between them.
Back to top
View user's profile Send private message
yogi.47eie

New User


Joined: 16 Aug 2006
Posts: 45
Location: india

PostPosted: Wed Jul 30, 2008 12:55 am
Reply with quote

Hi Terry,

i have mis spelled your name .... sorry for that,
as i requested can you please elaporate the same a little bit...
i never dealt with BBcode.. what exactly it does & usage..

Regards
Yogi
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Jul 30, 2008 1:08 am
Reply with quote

Answered your private msg.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 30, 2008 11:41 am
Reply with quote

VB tags l

Using VB tags to make your post more easily readable
Back to top
View user's profile Send private message
Sulabh Agrawal

New User


Joined: 29 Sep 2016
Posts: 4
Location: India

PostPosted: Thu Oct 20, 2016 6:19 pm
Reply with quote

Use SEARCHFOR '''YOGI'''.
Two single quotes to resolve One Single quote in your PDS and one for your search string. So by giving total three single quotes you can search.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Oct 20, 2016 6:26 pm
Reply with quote

Why do you think (if the word can be used in this context) that Yogi has not solved the problem in eight years?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top