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

Signed float variable representation


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

New User


Joined: 12 May 2009
Posts: 2
Location: Chennai

PostPosted: Wed Jun 24, 2009 4:25 pm
Reply with quote

Hi,
I have a doubt in sign notation. If we are moving a S9(16)V99 COMP-3 to a S9(16)v99 we are getting the lastbyte somewhat different. For example i have moved -15.98 to sign variable. If we display it, its showing as 159Q.
What does this Q represent. Will it include both sign bit and the last digit 8.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 4:37 pm
Reply with quote

1. any COBOL manual (programmers guide) will (in painful detail) explain exactly how numerics are stored in COMP-3(Packed-decimal), numeric display and even float (single and double) datatypes.

2. the following table will help you determining the value of 'overprint', or zoned-decimal representation:
Code:
0   {    
1   A
2   B
3   C
4   D
5   E
6   F
7   G
8   H
9   I
-0   }
-1   J
-2   K
-3   L
-4   M
-5   N
-6   O
-7   P
-8   Q
-9   R
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: Wed Jun 24, 2009 4:55 pm
Reply with quote

Dick,

Hex representation would have made the OP think a little more. icon_smile.gif

Regards,
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: Wed Jun 24, 2009 5:32 pm
Reply with quote

Quote:
Hex representation would have made the OP think a little more
Bill: you're presuming a bit much from someone who couldn't be bothered looking in the manual! icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 24, 2009 5:43 pm
Reply with quote

Quote:
Hex representation would have made the OP think a little more


me too!
Back to top
View user's profile Send private message
Rajapriyaa

New User


Joined: 12 May 2009
Posts: 2
Location: Chennai

PostPosted: Wed Jun 24, 2009 6:08 pm
Reply with quote

Hi All,
Thanks for the details. It helped me a lot to resolve the problem in time. Since i was in hurry to get the answer for this que, i have posted. Hereafter i will make sure that to look into the manual first. Thanks 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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top