Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
replacing characters in a string.....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
foliater

New User


Joined: 06 Apr 2006
Posts: 21

PostPosted: Mon May 29, 2006 7:40 pm    Post subject: replacing characters in a string.....
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
References
PostPosted: Mon May 29, 2006 7:40 pm    Post subject: Re: replacing characters in a string..... Reply with quote

unicorn

New User


Joined: 29 May 2006
Posts: 3

PostPosted: Tue May 30, 2006 11:08 am    Post subject: Re: replacing characters in a string.....
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1