The general format of a function-identifier is:
Format
>>-FUNCTION--function-name-1--+----------------------+---------->
| .------------. |
| V | |
'-(----argument-1-+--)-'
>--+--------------------+--------------------------------------><
'-reference-modifier-'
The following examples show an intrinsic function invocation for an alphanumeric source statement and a numeric source statement.
The alphanumeric source statement:
MOVE FUNCTION UPPER-CASE("hello") TO DATA-NAME.
replaces each lowercase letter in the argument with the corresponding uppercase letter, resulting in the movement of HELLO into DATA-NAME.
The numeric source statement,
COMPUTE NUM-ITEM = FUNCTION MEAN(A B C)
Adds the values of A, B, and C then divides by 3, and places the result in NUM-ITEM.
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.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.