ILE RPG Language Reference
Keep in mind the following when defining numeric fields:
- When coding the end position in positions 47 through 51 of the
output specifications, be sure to use the external format when calculating
the number of bytes to be occupied by the output field. For example,
a packed field with 5 digits is stored in 3 bytes, but when output
in zoned format, it requires 5 bytes. When output in integer format,
it only requires 2 bytes.
- If you move a character field to a zoned numeric, the sign of
the character field is fixed to zoned positive or zoned negative.
The zoned portion of the other bytes will be forced to 'F'. However,
if the digit portion of one of the bytes in the character field does
not contain a valid digit a decimal data error will occur.
- When numeric fields are written out with no editing, the sign
is not printed as a separate character; the last digit of the number
will include the sign. This can produce surprising results; for example,
when -625 is written out, the zoned decimal value is X'F6F2D5' which
appears as 62N.
[ Top of Page | Previous Page | Next Page | Contents |
Index ]