470,631 Members | 1,501 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,631 developers. It's quick & easy.

Integer binary representation

Hello!

Does anybody know what is binary representation of integer datatype
fields written to archlogs on z/OS (OS/390) machines? Is it "Two's
complement", "One's complement", Sign-modulo or whatever?

I would analyze it for myself if someone would provide me with some
binary (hex) representations of some numbers as: 0, 1, -1 and couple
more of your choice.

I will be very thankful for any hints.

Maciek
Aug 3 '06 #1
3 3972
shyha wrote:
Hello!

Does anybody know what is binary representation of integer datatype
fields written to archlogs on z/OS (OS/390) machines? Is it "Two's
complement", "One's complement", Sign-modulo or whatever?

I would analyze it for myself if someone would provide me with some
binary (hex) representations of some numbers as: 0, 1, -1 and couple
more of your choice.

I will be very thankful for any hints.
SELECT HEX(INTEGER(-1)) FROM SYSIBM.SYSDUMMY1
Should tell (I assume HEX() exists on DB2 for zOS)

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Aug 3 '06 #2
shyha wrote:
Hello!

Does anybody know what is binary representation of integer datatype
fields written to archlogs on z/OS (OS/390) machines? Is it "Two's
complement", "One's complement", Sign-modulo or whatever?

I would analyze it for myself if someone would provide me with some
binary (hex) representations of some numbers as: 0, 1, -1 and couple
more of your choice.

I will be very thankful for any hints.

Maciek
While Serge's reply lets you investigate for yourself, the direct answer
for both integer and smallint is big-endian two's complement. This is
different from Windows machines which are little-endinan and also AIX (I
think, it has been several years) which is also little-endian. Don't
even think about decoding floating point representation.
Aug 3 '06 #3
Serge Rielau napisal(a):
shyha wrote:
>Hello!

Does anybody know what is binary representation of integer datatype
fields written to archlogs on z/OS (OS/390) machines? Is it "Two's
complement", "One's complement", Sign-modulo or whatever?

I would analyze it for myself if someone would provide me with some
binary (hex) representations of some numbers as: 0, 1, -1 and couple
more of your choice.

I will be very thankful for any hints.

SELECT HEX(INTEGER(-1)) FROM SYSIBM.SYSDUMMY1
Should tell (I assume HEX() exists on DB2 for zOS)

Cheers
Serge
Hi! I checked this query but hex values are different than this visible
in archlog (we did some more research and found suitable data in
archlog). HEX function seems to give results in "two's complement"
system. We found out that (in archlog) binary representation seems to be
something like

value in archlog = value+2^(length-1)

for example: if we have 16bit integer of value -319
than we expect to see 7EC1 in archlog:

-319 + 2^(16-1) = -319 + 2^15 = -319 + 32768 = 32449 = 7EC1 hex

it seems like it's just moving 0 value across axis...

could anyone confirm that?

Cheers
Maciek
Aug 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark Dufour | last post: by
6 posts views Thread by Andrew | last post: by
6 posts views Thread by Madhusudan Singh | last post: by
17 posts views Thread by Mantorok Redgormor | last post: by
14 posts views Thread by junky_fellow | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.