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: 19244
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: 19244
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Finding record and replacing with val... DFSORT/ICETOOL 3
No new posts Replacing character string in file th... JCL & VSAM 9
No new posts Replacing PDSMAN with PDSFAST JCL & VSAM 10
No new posts JCL for replacing code in Cobol JCL & VSAM 7
Search our Forums:

Back to Top