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
 

 

Remove hex character in string using cobol

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

New User


Joined: 07 Dec 2007
Posts: 26
Location: Bangalore

PostPosted: Fri Nov 21, 2008 12:36 pm    Post subject: Remove hex character in string using cobol
Reply with quote

Hi,

I have a 'hex character' as part of a text string .
I want to remove this hex character and replace with spaces using a cobol statement.

For eg : THIS IS . ME

The . in the center represents the hex character . I want this to be replaced with spaces

like this : THIS IS ME .

I tried this command but its not removing the hex character.

INSPECT description REPLACING ALL LOW-VALUES BY SPACES

where description is the string with the hex character.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Nov 21, 2008 1:02 pm    Post subject:
Reply with quote

Hi,

Please show some actaul sample data in hex, ("HEX ON") and use the "Code" tag to make the data more readable as well as preserve alignment.
Back to top
View user's profile Send private message
Aniyaa

New User


Joined: 07 Dec 2007
Posts: 26
Location: Bangalore

PostPosted: Fri Nov 21, 2008 1:36 pm    Post subject:
Reply with quote

Suppose

The text is like this

input is

THIS IS X'30' ME (note: the x'30' is represented by a dot )

output has to be like

THIS IS ME
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Fri Nov 21, 2008 1:47 pm    Post subject: Reply to: Remove hex character in string using cobol
Reply with quote

let' s reword the issue..

how to substitute blanks for unprintable chars ( in ISPF are shown as dots )

is this correct ??
Back to top
View user's profile Send private message
Aniyaa

New User


Joined: 07 Dec 2007
Posts: 26
Location: Bangalore

PostPosted: Fri Nov 21, 2008 1:51 pm    Post subject:
Reply with quote

exactly... enrico....

so happy.... you could figure it out..


the unprintable chars are part of a string .. I need the string , after replacing the unprintable chars with spaces..

I can replace one unprintable character using this command

INSPECT itemdescription OF WS-XML-TAG-DEFINITIONS
REPLACING ALL X'30' BY SPACES

but can i replace all the possible unprintable characters using some command ?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Fri Nov 21, 2008 1:56 pm    Post subject: Reply to: Remove hex character in string using cobol
Reply with quote

I am in a good mood today icon_cool.gif

I searched the forum with "cobol unprintable" and ...

http://ibmmainframes.com/viewtopic.php?t=17858&highlight=cobol+unprintable
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Nov 21, 2008 5:09 pm    Post subject: Re: Remove hex character in string using cobol
Reply with quote

Another alternative --- Review the following (all postings of this LINK) -

http://ibmmainframes.com/viewtopic.php?t=32610&highlight=strip+function

Regards,

Bill
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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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