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



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.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.