Specifying a function

This topic describes the general format of a function-identifier.

Format: Function-identifier

Read syntax diagramSkip visual syntax diagramFUNCTIONfunction-name-1(argument-1)reference-modifier
Note: Start of changeThe keyword FUNCTION may be omitted if you specify the function name in the REPOSITORY paragraph of your program.End of change
function-name-1
function-name-1 must be one of the intrinsic function names.
argument-1
argument-1 must be an identifier, a literal (other than a figurative constant), or an arithmetic expression that satisfies the argument requirements for the specified function.
reference-modifier
Can be specified only for functions of type alphanumeric or national.

A function-identifier can be specified wherever a data item of the type of the function is allowed. The argument to a function can be any function or an expression containing a function, including another evaluation of the same function, whose result meets the requirements for the argument.

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.