Search code examples
typesibm-midrangerpgle

RPGLE - CL data types comparison


I'm asking myself what is the correct comparison of data types between RPGLE and CL in IBMi.

So:

*DEC  <> Packed numeric (es DCL-S ... PACKED(7:0))
*CHAR <> Fixed length string (es DCL-S ... CHAR(10))
*LGL  <> Indicator (es DCL-S ... IND)
*PTR  <> Pointer (es DCL-S ... POINTER)

What I'm missing are *INT and *UINT. Reading IBM Knowledge Center I found:

For character or integer CL variables, specify the number of bytes for the CL variable.

Then, are them BINDEC (in positional it's B) or INT/UNS (I/U) data types?


Solution

  • CL supports *INT and *UINT types
    Declaring variables to a CL program or procedure

    Which correspond directly to RPG's INT/UNS types.

    Do not ever use RPG's BINDEC type. It's an obsolete hack from before RPG supported true integer types.