The COBOL-85 Tutorial, Annexes.

Annexes.

Copyright © 1998-2003

Kim Kjærsulf.


This chapter (TOC)

Built-in Functions.

Built-in Functions.

[This chapter] [TOC] [Tutorial]


The built-in functions performs specific processing based on the values of several arguments and returns the result to the program.
The value of the function is called the "function value."

The built-in function module can be used in a statement in the PROCEDURE DIVISION. To use the built-in function module, write a function-identifier in the statement.

The following table lists the built-in functions that your compiler probably will support.

Function name Function value


ACOS
Reverse cosine of argument
ANNUITY
Equal payment amount for each quarter
ASIN
Reverse sine of argument
ATAN
Reverse tangent of argument
CHAR
A single character in the order of the argument according to the collating sequence
COS
Cosine of argument
CURRENT-DATE
Current date and time
DATE-OF-INTEGER
Integer format date converted to standard format date
DAY-OF-INTEGER
Integer format date converted to annual format date
FACTORIAL
Factorial of argument
INTEGER
Maximum integer not exceeding value of argument
INTEGER-OF-DATE
Standard format date converted to integer format date
INTEGER-OF-DAY
Annual format date converted to integer format date
INTEGER-PART
Integer part of argument
LENGTH
Length of argument (number of character positions or national character positions)
LOG
Natural logarithm of argument
LOG10
Common logarithm of argument
LOWER-CASE
Uppercase alphabetic characters in argument replaced by lowercase alphabetic characters
MAX
Maximum value in list of argument
MEAN
Arithmetic mean of list of argument
MEDIAN
Central value of list of argument
MIDRANGE
Arithmetic mean of minimum value and maximum value in list of argument
MIN
Minimum value in list of argument
MOD
Integer value of argument 1 modeled on argument 2
NUMVAL
Character-string in numeric literal format converted to a numeral
NUMVAL-C
Character-string in numeric literal format (including a currency sign or comma) converted to a numeral
ORD
The order of an argument according to the collating sequence
ORD-MAX
Position of argument having the maximum value
ORD-MIN
Position of argument having the minimum value
PRESENT-VALUE
Current value of each end of quarter
RANDOM
Pseudo-random number
RANGE
Difference between maximum value and minimum value in list of argument
REM
Remainder after dividing argument 1 by argument 2
REVERSE
Character-string of argument in reverse order
SIN
Sine of argument
SQRT
Square root of argument
STANDARD-DEVIATION
Standard deviation of list of argument
SUM
Sum of list of argument
TAN
Tangent of argument
UPPER-CASE
Lowercase alphabetic characters in argument replaced by uppercase alphabetic characters
VARIANCE
Variance of list of argument
WHEN-COMPILED
Program compile date and time


Copyright © 1998-2003

Kim Kjærsulf


Last Updated october 3, 2003
For more information contact: Kim Kjærsulf