The following are general rules that apply to all expressions:
Expressions are coded in the Extended-Factor 2 entry on the Calculation
Specification or after the operation code on a free-form calculation.
An expression can be continued on more than one specification. On a continuation
specification, the only entries allowed are C in column 6 and the
Extended-Factor 2 entry.
No special continuation character is needed unless
the expression is split within a literal or a name.
Blanks (like parentheses) are required only to resolve ambiguity. However,
they may be used to enhance readability.
Note that RPG will read as many
characters as possible when parsing each token of an expression. For example,
X**DAY is X raised to the power of DAY
X* *DAY is X multiplied by *DAY
The TRUNCNBR option (as a command parameter or as a keyword on a control
specification) does not apply to calculations done within expressions. When
overflow occurs during an expression operation, an exception is always issued.