473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

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 4133
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Dufour | last post by:
Hi all, I need to convert an integer into some binary representation. I found the following code in the online cookbook (adapted to return a list): binary = lambda n: n>0 and +binary(n>>1) or ...
6
by: Andrew | last post by:
Hi I have a question is there a function in C++ to convert an integer into a Binary number Thanks in Advance Cheers
6
by: Madhusudan Singh | last post by:
Hi I am using binascii.b2a_hex to convert some binary data to hex. The result is a two bit hex representation (i. e., without the leading hex). How do I convert the resulting two bit...
17
by: Mantorok Redgormor | last post by:
are all integers represented internally as just bit vectors? -- nethlek
20
by: GS | last post by:
The stdint.h header definition mentions five integer categories, 1) exact width, eg., int32_t 2) at least as wide as, eg., int_least32_t 3) as fast as possible but at least as wide as, eg.,...
3
by: Vish | last post by:
Hi All I have written a program to count the maximum contiguous set bits in an integer . Like if my binary representation of integer is : 1100111 : then output should be 3....
14
by: junky_fellow | last post by:
Can anybody please explain this: When a value with integer type is converted to another integer type other than _Bool, if the new type is unsigned, the value is converted by repeatedly...
16
by: Dave | last post by:
Hi all, I have a 4 byte char array with the binary data for two 16-bit signed integers in it like this: Index 3 2 1 0 Data Bh Bl Ah Al Where Bh is the high byte of signed 16-bit...
27
by: fdu.xiaojf | last post by:
Hi, String formatting can be used to converting an integer to its octal or hexadecimal form: '307' 'c7' But, can string formatting be used to convert an integer to its binary form ?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.