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
 
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: 10326
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: 10326
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: 2504
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

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