View previous topic :: View next topic
|
Author |
Message |
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
|