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
 

 

Wildcard Search in REXX
Goto page 1, 2  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Thu Jul 30, 2009 2:32 pm    Post subject: Wildcard Search in REXX
Reply with quote

Hi

How to make a wildcard search in REXX?
If I want to do a wild card search in a string like the following, how do to do it REXX?
Code:
'AB****B*'


I'm sure of only First, Second and 7th Character.
I want to figure all the variables like
Code:
'AB1234B5'
'AB4567B3'
'ABSDTTB2'
'AB34VBB7'


the above may be a part of the string like
Code:
'The data is sensitive, AB1234B5 the code'

I wanna find whether anything like 'AB****B*' is present.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jul 30, 2009 2:43 pm    Post subject:
Reply with quote

AFAIK there is no built in functions for a wildcard - so it looks as if you need to code and test your own logic here.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jul 30, 2009 8:29 pm    Post subject:
Reply with quote

If you are trying to acheive it in rexx code

Try some thing like

Code:


SUBSTR(STEM VARIABLE,1,2) = AB  and
SUBSTR(STEM VARIABLE,7,1) = B

 


Just gave a thought having assumtions.

Experts guide me
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 30, 2009 9:29 pm    Post subject:
Reply with quote

Code:

STRING.0 = 4
STRING.1 = 'ABCDEFGHIJKLMB'
STRIN0.2 = 'AB345B789'
STRING.3 = '13456789'
STRING.4 = '1234567890AB3456B789'

KEY_POS_1_2 = 'AB'
KEY_POS_7   =  'B'

    TRACE ?R

DO I = 1 TO STRING.0
   X = POS(KEY_POS_1_2,STRING.I)
   IF X > 0 THEN
      DO
        Y = POS(KEY_POS_7,STRING.I,X+2)
        IF Y > 0 THEN
           DO
             IF Y - X = 6 THEN
                DO
                   SAY 'HIT IN ' STRING.I
                END
           END
      END
END
EXIT


not elegant, but beggers can't be choosers;
they must create their own 'elegant' code.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jul 30, 2009 10:13 pm    Post subject:
Reply with quote

Much better [icon_smile.gif] Thanks dick

but beggers can't be choosers;

wht did you mean by that mind eloborating?

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

JCL Moderator


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

PostPosted: Thu Jul 30, 2009 11:20 pm    Post subject:
Reply with quote

It's a slang term meaning roughly that when you receive something for free, you don't have much of a right to complain about what you get. icon_smile.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Fri Jul 31, 2009 1:34 am    Post subject:
Reply with quote

Take a look at file 656 in CBTTAPE.

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

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Fri May 24, 2013 4:22 pm    Post subject: Reply to: Wildcard Search in REXX
Reply with quote

you can use the commands to search string


F ALL P'C==PO'

= -> wildcard charater
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri May 24, 2013 4:36 pm    Post subject: Reply to: Wildcard Search in REXX
Reply with quote

The discussion ended nearly four years ago.

Having said that, do you feel that you actually read the question?
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 72
Location: Chennai

PostPosted: Fri May 24, 2013 4:39 pm    Post subject: Reply to: Wildcard Search in REXX
Reply with quote

All discussion not ended Acutally.Let have a new Idea for wildcard search!!!
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri May 24, 2013 4:51 pm    Post subject:
Reply with quote

Bill,

That is why Friday is Psychic icon_cool.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri May 24, 2013 4:57 pm    Post subject: Re: Reply to: Wildcard Search in REXX
Reply with quote

cmsmoon wrote:
All discussion not ended Acutally.Let have a new Idea for wildcard search!!!

A good pre-condition would be having an idea that works.
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: Fri May 24, 2013 7:08 pm    Post subject:
Reply with quote

Hello,

Quote:
you can use the commands to search string
F ALL P'C==PO'
= -> wildcard charater
Where did you find documentation that says the "=" can be used as a wildcard?

Please do not post an untested/unworking "solution".

Also, when a topic has been dormant for so long, it is best to start a new topic and include the link to the old one if you feel it is necessary/useful.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri May 24, 2013 7:56 pm    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Quote:
you can use the commands to search string
F ALL P'C==PO'
= -> wildcard charater
Where did you find documentation that says the "=" can be used as a wildcard?

cmsmoon is confusing (to put it politely) Rexx with ISPF Edit; the equals sign is a generic wildcard in picture strings.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Wed May 29, 2013 2:11 am    Post subject: Reply to: Wildcard Search in REXX
Reply with quote

Quote:
confusing (to put it politely) Rexx with ISPF Edit

That is a great idea, Akatsukami: put the text in a file and then edit it with an initial macro that issues the FIND command. VPUT the return code of the FIND so that it can be found later by the caller.

But it is not very practical for a large amount of data to search through.
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 37
Location: Maryland

PostPosted: Tue Aug 09, 2016 9:43 pm    Post subject: Reply to: Wildcard Search in REXX
Reply with quote

/* REXX - verify wildcard without going into loop */

WildCard = 'ABC**1**Z'

String = 'We want to find something like ABC001xxZ but not ABC002xxY'

HiMask = Translate( WildCard, 'FF'x, '*' )
LowMask = Translate( WildCard, '00'x, '*' )

Do i = 1 to Words(String)
Single = Word( String, i )
HiSingle = BitAnd( Single, HiMask )
LowSingle = BitOr( Single, LowMask )
If HiSingle == LowSingle Then
Say "Word" Single "found - success!"
End i

return 0
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Aug 09, 2016 10:52 pm    Post subject:
Reply with quote

sergeyken, did you notice that you are responding to a topic with the last post 3 years ago and originally started 7 years ago?
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 37
Location: Maryland

PostPosted: Wed Aug 10, 2016 12:19 am    Post subject:
Reply with quote

Robert Sample wrote:
sergeyken, did you notice that you are responding to a topic with the last post 3 years ago and originally started 7 years ago?

Nevertheless the issue is as important as before.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Wed Aug 10, 2016 12:51 am    Post subject:
Reply with quote

sergeyken wrote:
Robert Sample wrote:
sergeyken, did you notice that you are responding to a topic with the last post 3 years ago and originally started 7 years ago?

Nevertheless the issue is as important as before.

It's a practice Not to answer a question Years after it was asked because:

1. The OP will not be interested in listening after Years of asking the question.

2. More importantly, the technology would/may have changed in those Years. So, the question itself would/may not be valid.

*Think about how you used to travel with Paper maps 10 Years ago. And now you have GPS. The question asked for a paper map would not be valid today And that is why It is Not a good practice to reply to Years old threads.

.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Aug 10, 2016 1:25 am    Post subject:
Reply with quote

Quote:
Nevertheless the issue is as important as before.
Along with what RahuldG31 said, You can always start a new post with the tested solution and link this old thread to it instead of waking up the dead thread which would be useful for others. May be this needs to get a lock now.
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.    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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