COBOL - Funções intrínsecas - Rules for usage
The topic describes rules of using different types of functions.
An alphanumeric function can be used as an argument for any function that allows an alphanumeric argument.
Reference modification of an alphanumeric function is allowed. If reference modification is specified for a function, the evaluation of the reference modification takes place immediately after the evaluation of the function; that is, the function's returned value is reference-modified.
An alphanumeric function cannot be used:
A national function can be used as an argument for any function that allows a national argument.
Reference modification of a national function is allowed. If reference modification is specified for a function, the evaluation of the reference modification takes place immediately after the evaluation of the function; that is, the function's returned value is reference-modified.
A national function cannot be used:
A UTF-8 function can be used as an argument for any function that allows a UTF-8 argument.
Reference modification of a UTF-8 function is allowed. If reference modification is specified for a function, the evaluation of the reference modification takes place immediately after the evaluation of the function; that is, the function's returned value is reference-modified.
A UTF-8 function cannot be used:
A numeric function can be referenced as an argument for a function that allows a numeric argument.
A numeric function cannot be used where an integer operand is required, even if the particular reference would yield an integer value. The INTEGER or INTEGER-PART functions can be used to force the type of a numeric argument to be an integer.
An integer function can be referenced as an argument for a function that allows a numeric argument.
Usage notes:
Published: 2020-12-14