Supported RPG Features

When the source of a MOVE/MOVEL is a numeric field (packed, zoned, integer, or unsigned) and the result is a character field, the value is copied as its unedited zoned external image: the magnitude digits zero-filled to the source's declared digit count, with no decimal point, and - for a negative value - the sign carried as the EBCDIC zone overpunch on the units (rightmost) digit (} for -0, J - R for -1 … -9). This is the same image %EDITC(x:'X') produces. MOVE right-aligns the image in the result; MOVEL left-aligns it. A positive value shows no sign glyph, and an unsigned source never carries a sign.

C                   MOVEL     Pk5N           Chr5         (PACKED(5:0)=-42    → '0004K')
C                   MOVE      Pk5N           Chr5         (PACKED(5:0)=-42    → '0004K')
C                   MOVEL     Pk52N          Chr5         (PACKED(5:2)=-12.34 → '0123M')
C                   MOVEL     Pk5P           Chr5         (PACKED(5:0)= 42    → '00042')
C                   MOVEL     Two            Res          (Res was 999999, Two=21    → 219999)
C                   MOVEL(P)  Two            Res          (Res was 999999, Two=21    → 210000)
C                   MOVEL     Neg            Res          (Res was 999999, Neg=-5    → 059999, positive)
C                   MOVEL     Src4           Res2         (Res2 is 2 digits, Src4=-1234 → 12-)