ILE COBOL Language Reference


Rules for Usage

Alphanumeric Functions
An alphanumeric function can be specified wherever an identifier is permitted in the general formats, and where the rules associated with the general formats do not specifically prohibit reference to functions. However it cannot be specified:

A reference modification for 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.

An alphanumeric function can be referenced as an argument for a function which allows an alphanumeric argument.

Numeric Functions
A numeric function can be used only where an arithmetic expression can be specified.

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 will 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.

+-------------------------------IBM Extension--------------------------------+

DBCS Functions
A DBCS function can be specified wherever a DBCS identifier is permitted in the general formats, and wherever the rules associated with the general formats do not specifically prohibit reference to functions. However, it cannot be specified:

A reference modification for a DBCS 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.

A DBCS function can be referenced as an argument for a function that allows a DBCS argument.

National Functions
A national function can be specified wherever a national identifier is permitted in the general formats, and wherever the rules associated with the general formats do not specifically prohibit reference to functions. However, it cannot be specified:

A national function can be referenced as an argument for a function that allows a national argument.

Date-Time Functions
A date-time function can be specified wherever a date-time identifier is permitted in the general formats, and wherever the rules associated with the general formats do not specifically prohibit reference to functions. However, it cannot be specified:

A date-time function is allowed as part of a relation condition. If a date-time function is specified in a relation condition, the evaluation of the relation condition takes place immediately after the evaluation of the function.

A date-time function can be referenced as an argument for a function that allows a date-time argument.

Boolean Functions
A boolean function can be specified wherever a boolean identifier is permitted in the general formats, and wherever the rules associated with the general formats do not specifically prohibit reference to functions. However, it cannot be specified:

A boolean function is allowed as part of a relation condition. If a boolean function is specified in a relation condition, the evaluation of the relation condition takes place immediately after the evaluation of the function.

A boolean function can be referenced as an argument for a function that allows a boolean argument.

+----------------------------End of IBM Extension----------------------------+

Integer Functions
An integer function can be used only where an arithmetic expression can be specified.

An integer function can be referenced as an argument for a function that allows an integer argument.

Special Usage Notes:
Identifiers in the USING phrase of the CALL statement must not be a function-identifier.

The COPY statement allows function-identifiers of all types in the REPLACING phrase.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]