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

Pl1 String Replacement


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Feb 23, 2009 8:53 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Feb 23, 2009 8:59 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
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 file manager is doing string conversion IBM Tools 3
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top