COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Table 103 Argument Types
What is Used in Determining the
Function’s Value
What You Must SpecifyArgument Type
Value of arithmetic expression,
including operational sign
Arithmetic expressionNumeric
Value of arithmetic expression,
including operational sign
Arithmetic expression that always
results in integer value
Integer
Value of argument and possibly its sizeElementary data item of the class
alphabetic, or nonnumeric literal
containing only alphabetic characters
Alphabetic
Value of argument and possibly its sizeData item of the class alphabetic or
alphanumeric, or nonnumeric literal
Alphanumeric
An arithmetic expression used as an argument can include subscripts, and any subscript can be
the keyword ALL. When ALL is a subscript, the effect is as if each table element associated with
that subscript position were specified. The order of the implicit specification of each occurrence is
from left to right. The leftmost specification is the identifier with each subscript specified by the
word ALL replaced by one. The next specification is the same identifier with the rightmost subscript
specified by the word ALL incremented by one. This process continues with the rightmost ALL
subscript being incremented by one for each implicit specification until the rightmost ALL subscript
has been incremented through its range of values. If there are additional ALL subscripts, the ALL
subscript immediately to the left of the rightmost ALL subscript is incremented by one, the rightmost
ALL subscript is set to one, and the process of varying the rightmost ALL subscript is repeated. The
ALL subscript to the left of the rightmost ALL subscript is incremented by one through its range of
values. For each additional ALL subscript, this process is repeated until the leftmost ALL subscript
has been incremented by one through its range of values. If the ALL subscript is associated with
an OCCURS DEPENDING clause, the object of the OCCURS DEPENDING clause determines the
range of values. The evaluation of an ALL subscript must result in at least one argument, or the
result of the reference to the function-identifier is undefined.
An invalid argument causes a run-time error. In the non-CRE environment, it is error 130 (“Invalid
function parameter”). In the CRE, it is error 40 (“Invalid function parameter”). If you are executing
an old object file on a newer system, the error might be “Corrupted environment.
ACOS Function
ACOS, a numeric function, returns a value in radians that approximates the arccosine of its
argument.
argument
is a numeric argument whose value is in the range -1 to +1.
The returned value approximates the arccosine of the value of argument. It is a floating-point
number in the range zero to pi. It has no implied decimal point and is precise to approximately
14 digits.
658 Intrinsic Functions