REGISTER or login:
Either of these D-spec declarations
D myInteger1 S 4b 0D myInteger2 S 10i 0
The linked article is incorrect in its reference to the 'B' data type:
In past releases of OS/400, it was common to represent integer data as
4B 0 fields (4 byte binary integer). Many of the IBM API manuals still
reference a 2- or 4-byte binary representation,...
A [4B 0] declaration does not represent a "4 byte binary integer". It means that values will be stored in binary integer format and that the maximum value cannot exceed four decimal digits. An actual "4 byte binary integer" can hold values much larger than 9999. A [4B 0] declaration is much more like a "2 byte binary integer", though it's still limited to 9999 as a maximum value.
The IBM API documents correctly refer to "4 byte binary integer" variables and are not related directly to RPG's [4B 0] declarations. The nearly equivalent RPG 'B' data type declaration would require having starting and ending positions rather than a single 'length' specification.
For reasons like that, the [4B 0] notation probably should never be used nowadays. Use 'I' data types for signed integers and 'U' for unsigned integers. The 'B' data type has only a very few specific uses in current RPG coding. It can be used as a way precisely to include fractional decimal digits in memory while using a kind of binary integer memory format. (It's not clear why anyone would need to do that rather than use packed-decimal.)
Agreed -- picked up the 4b 0 from another process. I think we used 9b 0 before integer.types were introduced.
D myInteger2 S 10i 0
or for unsigned...
D myInteger2 S 10u 0