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: 1894
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: 7315

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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

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