On 2012-10-31, at 3:58 PM, midrange-l-request@xxxxxxxxxxxx wrote:
I did find that there is a EXTBININT header spec, but I don't really see the purpose to using it (I mean I know you can then access the 10th digit, in the case of 9b 0, but does that 10th digit get stored on the file?
An integer is defined as 10 long because there can be 10 digits in the number. Historically RPG limited binary to the maximum number of complete _range_ digits - hence 9 because 999,999,999 can be accommodated in a 4 byte integer but 9,999,999,999 cannot.
EXTBINIBT(*YES) tells RPG to leave the binaries as _real_ integers and NOT to attempt to convert them to 9 packed for operational use. That is what happens with the old B type - every time they are used they are converted to packed, the operation performed and then converted back to binary. All to make sure they don't exceed 9 digits. Very inefficient. For compatibility reasons RPG IV did the same as RPG/400 - hence EXTBINIBT(*YES) is not the default.
If you want to continue the conversation please move it to RPG400 or David will descend upon us from a great height.
Are there any gotchas to using the B data type?
Not that I can think of but see above re the performance benefit of of using EXTBINIBT(*YES).