Some errors are detectable at compile time when their operands are constant - a literal, a named constant, or a constant expression. The compiler rejects these up front, as IBM's ILE RPG compiler does, rather than letting them fail at run time. Exercising the corresponding runtime behavior requires a variable operand.
These carry IBM's RNF codes rather than TRN codes, because they mirror IBM i's diagnostics exactly.
| Code | Message | Cause |
|---|---|---|
| RNF7504 | Expression contains division by zero. | A division whose divisor folds to a constant zero (e.g. EVAL x = a / 0). |
| RNF5039 | Factor 2 entry of 0 is not allowed for DIV operation. | A fixed-format DIV whose Factor 2 folds to a constant zero. |
| RNF5185 | The occurrence number specified in Factor 1 is not valid. | An OCCUR whose Factor 1 folds to a constant outside 1..OCCURS(n). |