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