COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-7
Argument Types
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.”
Table 14-6. Argument Types
Argument
Type What You Must Specify
What is Used in Determining the
Function’s Value
Numeric Arithmetic expression Value of arithmetic expression,
including operational sign
Integer Arithmetic expression that
always results in integer value
Value of arithmetic expression,
including operational sign
Alphabetic Elementary data item of the
class alphabetic, or nonnumeric
literal containing only alphabetic
characters
Value of argument and possibly its size
Alphanumeric Data item of the class alphabetic
or alphanumeric, or nonnumeric
literal
Value of argument and possibly its size