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
 

 

Pl1 String Replacement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
nehrujee

New User


Joined: 25 Oct 2007
Posts: 8
Location: Kolkata

PostPosted: Mon Feb 23, 2009 8:42 pm    Post subject: Pl1 String Replacement
Reply with quote

Hi,

I would like to know the code snippet for String Replacement in PL1.

Source String = ' PL1 programming example'


In the above SourceString I need to replace
' programming ' with ' language '

And the output should be = ' PLI Language example'

Thanks in Advance.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7997
Location: Bellevue, IA

PostPosted: Mon Feb 23, 2009 8:53 pm    Post subject:
Reply with quote

There's a link at the top of the page to manuals, including the PL/I Language Reference. Look up INDEX and SUBSTR in that manual, then think about how they could be used for your requirement.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Feb 23, 2009 8:59 pm    Post subject: Reply to: Pl1 String Replacement
Reply with quote

Review the SUBSTR function, using a variable (FIX BIN (15) would be best) for the "starting point" together with a hard-coded length in a DO WHILE loop.

Regards,
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


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