× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Buzz wrote:
>I have the following definition in a data structure; I'm grouping it with
>two other fields for some search criteria:

>0024.00 D l1_mtrnbr                        4p 0

4p 0 is a 4 length packed number, which takes up 3 bytes of storage.
Divided number of digits by 2 and one half of a byte (a nibble) for sign.  4
/ 2 = 2 full bytes, plus 1/2 of a byte = 3 bytes.

>0001.72     84=I                             P   16   19 0L1_MTRNBR

P   16   19 0 is a 7 length packed number taking up 4 bytes of storage.  In
4 bytes we can fit 7 numbers plus the sign nibble.

Your D spec should be either:

D l1_mtrnbr                        7p 0
or
D l1_mtrnbr                        6p 0

6p 0 and 7p0 both fit in 4 bytes.
7 / 2 = 3 and a nibble, plus sign nibble = 4.
6 / 2 = 3 plus sign nibble = 3 1/2 = 4.

I know Hans explained it, just hoping to make it a little clearer, or to
confuse you more, whichever works :)

HTH,

Regards,

Jim Langston



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.