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
 
Inspecting a phrase and replacing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Inspecting a phrase and replacing
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

Site Director


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

PostPosted: Tue Mar 24, 2009 8:59 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Mar 24, 2009 9:38 am    Post subject: Reply to: Inspecting a phrase and replacing
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts replacing junk with hyphen Nitin32 DFSORT/ICETOOL 10 Fri Jun 02, 2017 7:47 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Replacing Start Transid with LINK pkmurali CICS 12 Tue Apr 19, 2016 8:22 pm
No new posts ADRDSSU Restore - How to prevent repl... Lipi.Prasannan JCL & VSAM 12 Fri Oct 02, 2015 12:13 am
No new posts Matching and replacing JOIN KEYS for ... JAYACHANDRAN THAMPY SYNCSORT 17 Mon Feb 16, 2015 5:03 am

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