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

replacing characters in a string.....


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
foliater

New User


Joined: 06 Apr 2006
Posts: 31

PostPosted: Mon May 29, 2006 7:40 pm
Reply with quote

let us assume we have

x = 'fivestar'

i need to replace 'star' in 'fivestar' by 'sun'

can anyone help me regarding this....
Back to top
View user's profile Send private message
unicorn

New User


Joined: 29 May 2006
Posts: 3

PostPosted: Tue May 30, 2006 11:08 am
Reply with quote

The following code should help you....

/*=============REXX============== */
a = 'star'
b = 'sun'
x = 'fivestar'
p = pos(a,x)
x = delstr(x,p,length(a))
x = insert(b,x,p-1,length(b))
say x
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top