IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX help - - find all the substrings in a string


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Oct 15, 2011 9:33 am
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: 2455
Location: Hampshire, UK

PostPosted: Sat Oct 15, 2011 11:46 am
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: 8797
Location: Welsh Wales

PostPosted: Sat Oct 15, 2011 11:58 am
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Oct 15, 2011 1:10 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top