ILE COBOL Language Reference

Order of Precedence for the Evaluation of Function Arguments

When a function is evaluated, its arguments are evaluated individually in the order specified in the list of arguments, from left to right. The argument being evaluated can be a function-identifier, or it can be an expression containing function-identifiers.

If an arithmetic expression is specified as an argument, and if the first operator in the expression is a unary plus or a unary minus, it must be immediately preceded by a left parenthesis. For example, function MEAN(x-y z) would be the mean of two arguments: x-y and z.

To get the mean of the unary minus of y, the parentheses would be added as follows:

MEAN((x) (-y) z)
Note:
As in the preceding example, when you are taking the mean of unary minus and the unary minus is not the first of multiple arguments, you also need to enclose the preceding arguments in brackets. This ensures that the unary minus, (-y) in this example, will not be interpreted as a subscript.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]