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
 

 

To delete a charecter in a record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Wed Dec 17, 2008 6:32 pm    Post subject: To delete a charecter in a record
Reply with quote

In a record do we have some INSPECT Verb which will Delete a charecter.

For Ex.

I/P:AABCCCBDDB
O/P:AACCCDD

I dont know the no of times B appears so cant use UNSTRING Delimeted by 'B' and String it back.


Can anyone help me in cobol how to achieve this
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Wed Dec 17, 2008 6:40 pm    Post subject:
Reply with quote

Use reference modification to create the output data byte-by-byte from the input, not adding the characters you don't want to the output.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 17, 2008 8:31 pm    Post subject:
Reply with quote

dp33770,

you have a field that contains data, some of which you wish to delete.

as Robert said, you can index (reference modification) thru the field ony copying those characters that you want

or
Quote:

I dont know the no of times B appears so cant use UNSTRING Delimeted by 'B' and String it back.


your input field has a length - X.

so, you can only have a maximum number of 'B's - X.

An UNSTRING could be easily written.
You would only need X number of receiving fields (each with a length of X),
then STRING them back using spaces as a delimiter.
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 JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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