× 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.



Scott wrote:
>Oh, yes... I knew they added 8-bit integer fields, but I didn't realize
>that they continued to expand the (worthless) "B" data type to 8-bits as
>well.

Just to comment further on the binary and integer types:

RPG does not have 1-byte (8-bit) binary numerics.  Binary
decimal numeric can occupy either 2 or 4 bytes, with
decimal precisions from 1 to 9 digits (and 1 to 9 decimal
places).  A 1B0 binary decimal variable occupies 2 bytes,
even though 1 would suffice.

Integer numeric variables can occupy 1, 2, 4, or 8 bytes.
(Defined as 3I0, 5I0, 10I0, and 20I0 respectively.)

Just to confuse matters, fields defined in DDS as "B" can
hold values in the same range as true integer values, but
for compatibility with old programs, get treated as binary
decimal numeric within RPG.  (And by default, the internal
fields will get defined as packed decimal within the RPG
program.)

You can define 8-byte binary numerics in DDS, by coding 10
or more for the field length and "B" as data type.  DDS
will not allow decimal positions greater than 0 in this
case, and RPG will treat the field as true integer.

RPG will treat any DDS binary with zero decimal places as
true integer if you code H-Spec option EXTBININT(*YES).

Confused yet?

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com



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.