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
 
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: 8165
Location: East Dubuque, Illinois, USA

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: 6968
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Delete IMS remote transaction when MO... Sam Singh IMS DB/DC 0 Wed Aug 23, 2017 9:12 pm

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