iSeries / AS400 FAQ : Programming : RPG : What does BINARY(4) mean in API documentation?
BINARY(4) means a 4-byte binary number. In RPG III, this means a subfield of a data structure that is defined with 4 bytes, and has the ‘B’ type. In RPG IV, there are two kinds of 4-byte binary number: the 10-digit integer or the 9-digit binary. The 10-digit integer is better when dealing with APIs. If you define an integer or binary number using length notation (no from-position), you give the number of digits. 10I-0 or 9B-0. A very common error is to define a BINARY(4) field or parameter using length notation as 4B-0. This always causes problems calling the API.