Function Types [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation
HP COBOL II/XL Reference Manual
Function Types
Functions are treated like temporary, elementary data items. Use them
wherever you would use an elementary data item, with the exceptions noted
below. Functions cannot be receiving operands. Functions return
alphanumeric, numeric, or integer values, as follows:
* Alphanumeric functions are of the class and category alphanumeric,
and have an implicit usage of DISPLAY.
* Numeric functions are of the class and category numeric and always
have an operational sign. Numeric functions can only be used in
arithmetic expressions (such as in COMPUTE statements, relation
conditions, or reference modification) and cannot be used where an
integer operand is required, even if the function call might yield
an integer value.
* Integer functions are of the class and category numeric and always
have an operational sign. The definition of an integer function
provides that all digits to the right of the decimal point are
zero in the returned value for any possible evaluation of the
function. Integer functions can only be used in arithmetic
expressions. For example, the statement
MOVE FUNCTION SIN(5) TO A
is illegal, whereas the statement
COMPUTE A = FUNCTION SIN(5)
is legal.
MPE/iX 5.0 Documentation