Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Value of Floating Point Fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Value of Floating Point Fields
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Mon Dec 08, 2008 9:58 pm    Post subject:
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    Post subject: Reply to: Value of Floating Point Fields
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Mon Dec 08, 2008 11:34 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us