Function definition and evaluation

The class and characteristics of a function, and the number and types of arguments it requires, are determined by its function definition.

These characteristics include:

  • For functions of type alphanumeric and national, the size of the returned value
  • For functions of type numeric and integer, the sign of the returned value and whether the function is integer
  • The actual value returned by the function

For some functions, the class and characteristics are determined by the arguments to the function.

The evaluation of any intrinsic function is not affected by the context in which it appears; in other words, function evaluation is not affected by operations or operands outside the function. However, evaluation of a function can be affected by the attributes of its arguments.

Within a PROCEDURE DIVISION statement, each function-identifier is evaluated at the same time as any reference modification or subscripting associated with an identifier in that same position would be evaluated.