Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1951
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: 8631
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: 7314

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
No new posts attchmvs from rexx subroutine that re... harisukumaran CLIST & REXX 1 Fri Jan 19, 2018 5:29 am
No new posts Can we create REXX ouput in an Excel ... upendrasri CLIST & REXX 3 Wed Jan 17, 2018 8:19 pm
No new posts Need to obtain VTOC information via R... djeffbland CLIST & REXX 10 Thu Jan 11, 2018 4:13 am
No new posts REXX contest sergeyken CLIST & REXX 2 Tue Jan 09, 2018 1:55 am
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us