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
 
replacing characters in a string.....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    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

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
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 Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm
No new posts String after '.' (period) is not copy... balaji81_k SYNCSORT 6 Wed Aug 23, 2017 9:35 pm

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