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: 1756
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: 7307

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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


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