|
On 3/18/2011 11:52 AM, Vern Hamberg wrote:
Isn't a B (binary) type defined as 2 or 4 or 8? The number of bytes? Not
the number of digits? I'd recommend 5i 0. That's what the Data Type
Compatibility chart says in the Run-Time Library Reference. Both int and
long int are 10i 0.
The RPG and DDS B type is actually a decimal type, with decimal
positions. It's just stored as a binary. In RPG, it gets converted back
and forth to packed before it is used. So you can define a B-binary as 2
digits with 1 decimal place or 8 digits with 3 decimal places etc.
5B uses a 4-byte binary for storage, so for sure it isn't a match for a
short integer.
I think the 2B used in the SQL examples was probably a misunderstanding
probably caused by translating from the RPG III from-and-to positions
1-2B. It works ok though, and I think you could even get away with 1B
for the SQL indicator since anything from 1 to 4 digits means two bytes.
I agree that 5i makes the most sense.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.