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

Value of Floating Point Fields


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
frankvijt

New User


Joined: 18 Jan 2008
Posts: 2
Location: belgium

PostPosted: Mon Dec 08, 2008 9:42 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Dec 08, 2008 9:58 pm
Reply with quote

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
View user's profile Send private message
frankvijt

New User


Joined: 18 Jan 2008
Posts: 2
Location: belgium

PostPosted: Mon Dec 08, 2008 10:30 pm
Reply with quote

Thanks Robert for the quick answer and the additional extra information!
That solves my query perfectly.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Dec 08, 2008 11:34 pm
Reply with quote

Glad to hear it.
Back to top
View user's profile Send private message
avina

New User


Joined: 04 Dec 2007
Posts: 16
Location: Kolkata

PostPosted: Mon Mar 09, 2009 4:59 pm
Reply with quote

Thanks a lot for your reply. It helps a lot.
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Point and Shoot )PTNS TSO/ISPF 0
No new posts A directory in the pathname was not f... ABENDS & Debugging 0
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts How to remove DECIMAL POINT (.) from ... SYNCSORT 10
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
Search our Forums:

Back to Top