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

Example 194 INTEGER-PART Function
Code:
DISPLAY FUNCTION INTEGER-PART (-1.5)
DISPLAY FUNCTION INTEGER-PART (-1)
DISPLAY FUNCTION INTEGER-PART (0)
DISPLAY FUNCTION INTEGER-PART (1)
DISPLAY FUNCTION INTEGER-PART (1.5)
Output:
-1
-1
0
1
1
LENGTH Function
LENGTH, an integer function, returns the length of its argument (the number of character positions
it has, regardless of its current value).
argument
is a nonnumeric literal or data item of any class or category.
The returned value is determined as shown in this table. It includes any implicit FILLER characters.
Returned Valueargument
Length of the value of argument.nonnumeric literal or
elementary data item or
data structure that does not
contain a variable occurrence
data item
Length of the current value of the data item specified in the DEPENDING
phrase of the OCCURS clause for the variable occurrence data item. The
current value is determined as if the data item were a sending data item.
data structure containing a
variable occurrence data item
670 Intrinsic Functions