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: 8057
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: 6967
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


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