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
 

 

REXX help - - find all the substrings in a string

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
vijay

New User


Joined: 13 Aug 2003
Posts: 1

PostPosted: Sat Oct 15, 2011 7:48 am    Post subject: REXX help - - find all the substrings in a string
Reply with quote

Hi,
I need a rexx function with identifying all substrings in the string that start with %HLQS and end with a ',' ' ' '+' or ')'

STR1="AFTER ( %HLQS.A.B.1,%HLQS.A.B.2,%HLQS.A.B.3 +

output would be : %HLQS.A.B.1 %HLQS.A.B.2 %HLQS.A.B.3

STR2=" %HLQS.A.B.4,%HLQS.A.B.5,%HLQS.A.B.6 +
output would be : %HLQS.A.B.4 %HLQS.A.B.5 %HLQS.A.B.6


STR3=" %HLQS.A.B.7,%HLQS.A.B.8,%HLQS.A.B.9.0)
output would be : %HLQS.A.B.7 %HLQS.A.B.8 %HLQS.A.B.9.0


thanks,
vijay
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: Sat Oct 15, 2011 9:33 am    Post subject:
Reply with quote

Hello,

I suspect your examples are rather incomplete, but if what you show is what you want, why not simply change a quote or a comma or a plus etc to a space?

Kinda late and i may have misunderstood. . .
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Sat Oct 15, 2011 11:46 am    Post subject:
Reply with quote

WORDPOS, VERIFY, INDEX. WORDPOS would be best
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: Sat Oct 15, 2011 11:58 am    Post subject:
Reply with quote

A simple use of the TRANSLATE and WORD function
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Oct 15, 2011 1:10 pm    Post subject: Re: REXX help - - find all the substrings in a string
Reply with quote

You have a block of text which looks like this:

Code:

AFTER ( %HLQS.A.B.1,%HLQS.A.B.2,%HLQS.A.B.3 +
        %HLQS.A.B.4,%HLQS.A.B.5,%HLQS.A.B.6 +
        %HLQS.A.B.7,%HLQS.A.B.8,%HLQS.A.B.9.0)


And you want it to look like this:

Code:

        %HLQS.A.B.1 %HLQS.A.B.2 %HLQS.A.B.3 
        %HLQS.A.B.4 %HLQS.A.B.5 %HLQS.A.B.6 
        %HLQS.A.B.7 %HLQS.A.B.8 %HLQS.A.B.9.0


This would be an "editor job" as a once-off.

Edit macro? The editing suggestions you've already had if using rexx? Depends what you want it for.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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