IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To delete a charecter in a record


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dp33770

New User


Joined: 04 Jul 2007
Posts: 91
Location: Hyderabad

PostPosted: Wed Dec 17, 2008 6:32 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 17, 2008 6:40 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts DELETE SPUFI DB2 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top