Page 1 of 1

Mainframe storage of numbers question

PostPosted: Wed Mar 22, 2017 9:08 am
by pintu1228
Hi everyone,

I just wanted to know what the value -8453.234 looks like in mainframe storage if stored in packed decimal and also if stored in zone decimal.

Can anyone help me understand this??


Thanks

Re: Mainframe storage of numbers question

PostPosted: Wed Mar 22, 2017 10:09 am
by steve-myers
In hexadecimal representation
Packed - 8453234D
Zoned - F8F4F5F3F2F3D4

There are other, equally valid representations.

The last byte reflects the "preferred" sign for a negative number.

You can find more information through this link.

Re: Mainframe storage of numbers question

PostPosted: Wed Mar 22, 2017 2:31 pm
by Robert Sample
One thing to note is that the decimal point itself is NOT stored in either zoned decimal nor packed decimal -- it is an implied decimal point only. If you need the decimal point stored, you use the "numeric edited" form of the PICTURE clause in COBOL.

Re: Mainframe storage of numbers question

PostPosted: Wed Mar 22, 2017 2:52 pm
by enrico-sorichetti
the manual
z/Architecture Principles of Operation

available here ( You might need to register to download )
https://www-304.ibm.com/support/docview ... c500428f9a

will tell all You might want to know about internal number representation