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

Remove hex character in string using cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Fri Nov 21, 2008 1:02 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2008 1:47 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 21, 2008 1:56 pm
Reply with quote

I am in a good mood today icon_cool.gif

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

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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Nov 21, 2008 5:09 pm
Reply with quote

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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top