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

how to convert hexadecimal to alphanumeric


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

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Jan 08, 2008 10:59 am
Reply with quote

HI all,

i have got a requirement in which i have to change hexadecimal value in a big flat file to corresponding alphanumeric where i find these.can i
write a program to perform this operation.
hope you got my question.



Thank you.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 08, 2008 11:39 am
Reply with quote

Hi,

I think you may be misusing the terms Hex and Aupha/num.

Why don't you provide examples and show us what the hex looks like in memory and what it is changed to in its A/N form? That might give us what we need to help you.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Jan 08, 2008 12:33 pm
Reply with quote

HI,

its a big flat file so i dont know where this garbage values are.I mean to say that in file where ever i find some hexadecimal value i have to change it in alphanumeric.Is there any way where we read through the file
and change these hez value to alphanumeric.Hope you got what i said.

reply if u have any doubt.

Thanks
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Jan 08, 2008 12:37 pm
Reply with quote

Quote:
its a big flat file so i dont know where this garbage values are.

How can you say HEX values are garbage values?

Does the file has any LAYOUT? Dont say you had created a file without any layout.
Back to top
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Jan 08, 2008 4:55 pm
Reply with quote

i was not mean its a garbage value i mean to say that it is not the desired value.
as in file in general there has to be the value in the alphanumeric form
but in some places i find values like hexadecimal form.So can you please help me regarding this how to remove these values.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jan 08, 2008 5:04 pm
Reply with quote

Sorry, we all might be dumb, but Your requirement is not clear, or rather the description is confusing..

point one... everything is hexadecimal
point two... nothing is garbage per se
but ... garbage would be
-alphabetic chars in a numeric field,
-non display char in an alphabetic fields,
-date wrong in se "2008/42/42",
numbers-dates out of application determined bounds
...
... add as many as You want

does Your record have some kind of layout yes/no

does Your record consist only of one big field,
to be considered not garbage only if everything is displayable yes/no

please be more specific on your definition of garbage
think in MF terms... files/records/layout
Back to top
View user's profile Send private message
nitesh.mulay

New User


Joined: 30 May 2006
Posts: 10
Location: Pune

PostPosted: Tue Jan 08, 2008 5:08 pm
Reply with quote

I think the file will contain all the characters in normal form and not in hexadecimal form. you can view those characters in Hexadecimal format with "HEX ON" command.General character and hexadecimal character cannot be present at a time in a file.
Just check whether the values are hexadecimal values or junk characters (coming because of no initialisation etc)
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Jan 08, 2008 6:31 pm
Reply with quote

Nitesh - see Enrico's point one, which is actually points one, two, three, ..., ten.

EVERYTHING is made of bits, and 8 bits make a byte, and a hexadecimal digit (?) is just a convenient way to represent 4 bits, so two of them represent a byte.

Binary, packed-dec, 1's complement, floating point, display - who cares - they're all hexadecimal in an 8-bit byte computer.

(In older days, we grouped by 3 bits, and base 8 was commonly used to represent the two 3-bit parts of a 6-bit field.)
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Jan 08, 2008 7:17 pm
Reply with quote

Purnendu.it wrote:
its a big flat file so i dont know where this garbage values are.

You can paste some of the records to give us an idea about records to which you are referring as HEX & the corresponding output.
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 Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top