View previous topic :: View next topic
|
Author |
Message |
frankvijt
New User
Joined: 18 Jan 2008 Posts: 2 Location: belgium
|
|
|
|
I am working on a conversion project, which involves reading out a whole lot of good old VSAM files , which contain valuable data.
The original programming language, used to store these data, is PL/I. Some of the fields have been defined as FLOAT(6).
As such that is no problem, as I just dump the data via PUT SKIP EDIT statements onto flat files, that then get converted to txt files for our PC wiz kids to do their evil stuff with.
I do however want to make sure that the wiz kids get the right data. I can display the data in the files in hex, which is fine for reading and checking binary or dec fields. For Float however it isn't as straight forward.
For example, I have a field which is defined FLOAT(6) and has the hexadecimal value :
4100
1000
I believe this to be the representation of 1.00000
Some convertor, that I found on the net, however tries to tell me that it represents the value 9.00000, which got me confused.
Does any one have any experience with this and how did you handle it?
Thanks! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
It has been a while, but floating point numbers are expressed in terms of a sign bit, biased exponent for 7 bits (hex 40 is the normal bias, so 41 means the number is times 10), and the remaining bits represent the value. I've confirmed via SAS that 41100000 is 1.E0 floating point. |
|
Back to top |
|
|
frankvijt
New User
Joined: 18 Jan 2008 Posts: 2 Location: belgium
|
|
|
|
Thanks Robert for the quick answer and the additional extra information!
That solves my query perfectly. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Glad to hear it. |
|
Back to top |
|
|
avina
New User
Joined: 04 Dec 2007 Posts: 16 Location: Kolkata
|
|
|
|
Thanks a lot for your reply. It helps a lot. |
|
Back to top |
|
|
|