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

Inspecting a phrase and replacing


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bamohan

New User


Joined: 29 Jan 2007
Posts: 33
Location: chennai

PostPosted: Tue Mar 24, 2009 8:46 am
Reply with quote

Hi,

Can this be done by using INSPECT or some other cobol functions?

Basically, in the below example i need to replace the phrase COBOL and its subsequencent three characters with spaces. The three characters are dynamic and it can hold any numeric/alphanumeric/special characters.

Please help!

Example:

Input String : This forum is very useful to solve COBOL III, COBOL ABC, COBOL XYZ, COBOL XXX technical problems .

Output String : This forum is very useful to solve technical problems .
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19245
Location: Inside the Matrix

PostPosted: Tue Mar 24, 2009 8:59 am
Reply with quote

Hello,

Your "output" does not match your "rules". Where did the commas go?

To do what you want, you can write code using reference modificaton to locate and bypass the content you want left out of the result string.
Back to top
View user's profile Send private message
bamohan

New User


Joined: 29 Jan 2007
Posts: 33
Location: chennai

PostPosted: Tue Mar 24, 2009 9:08 am
Reply with quote

Oh. I missed to out to include the commas. Ok i will try out reference modification.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19245
Location: Inside the Matrix

PostPosted: Tue Mar 24, 2009 9:38 am
Reply with quote

Good luck icon_smile.gif

d
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JCL for replacing code in Cobol JCL & VSAM 7
No new posts special characters pipes "|"... COBOL Programming 1
No new posts Green beard: Have I coined a phrase? General Talk & Fun Stuff 3
No new posts replacing junk with hyphen DFSORT/ICETOOL 10
No new posts Replacing same string with different ... DFSORT/ICETOOL 6
Search our Forums:

Back to Top