内在函数
COBOL 2014 列出了以下标准内在函数:
======================================== ==========
Intrinsic Function Parameters
======================================== ==========
FUNCTION ABS 1
FUNCTION ACOS 1
FUNCTION ANNUITY 2
FUNCTION ASIN 1
FUNCTION ATAN 1
FUNCTION BOOLEAN-OF-INTEGER 2
FUNCTION BYTE-LENGTH 1
FUNCTION CHAR 1
FUNCTION CHAR-NATIONAL 1
FUNCTION COMBINED-DATETIME 2
FUNCTION COS 1
FUNCTION CURRENCY-SYMBOL 0
FUNCTION CURRENT-DATE 0
FUNCTION DATE-OF-INTEGER 1
FUNCTION DATE-TO-YYYYMMDD Variable
FUNCTION DAY-OF-INTEGER 1
FUNCTION DAY-TO-YYYYDDD Variable
FUNCTION DISPLAY-OF Variable
FUNCTION E 0
FUNCTION EXCEPTION-FILE 0
FUNCTION EXCEPTION-FILE-N 0
FUNCTION EXCEPTION-LOCATION 0
FUNCTION EXCEPTION-LOCATION-N 0
FUNCTION EXCEPTION-STATEMENT 0
FUNCTION EXCEPTION-STATUS 0
FUNCTION EXP 1
FUNCTION EXP10 1
FUNCTION FACTORIAL 1
FUNCTION FORMATTED-CURRENT-DATE 1
FUNCTION FORMATTED-DATE 2
FUNCTION FORMATTED-DATETIME Variable
FUNCTION FORMATTED-TIME Variable
FUNCTION FRACTION-PART 1
FUNCTION HIGHEST-ALGEBRAIC 1
FUNCTION INTEGER 1
FUNCTION INTEGER-OF-BOOLEAN 1
FUNCTION INTEGER-OF-DATE 1
FUNCTION INTEGER-OF-DAY 1
FUNCTION INTEGER-OF-FORMATTED-DATE 2
FUNCTION INTEGER-PART 1
FUNCTION LENGTH 1
FUNCTION LENGTH-AN 1
FUNCTION LOCALE-COMPARE Variable
FUNCTION LOCALE-DATE 2
FUNCTION LOCALE-TIME 2
FUNCTION LOCALE-TIME-FROM-SECONDS 2
FUNCTION LOG 1
FUNCTION LOG10 1
FUNCTION LOWER-CASE 1
FUNCTION LOWEST-ALGEBRAIC 1
FUNCTION MAX Variable
FUNCTION MEAN Variable
FUNCTION MEDIAN Variable
FUNCTION MIDRANGE Variable
FUNCTION MIN Variable
FUNCTION MOD 2
FUNCTION MODULE-CALLER-ID 0
FUNCTION MODULE-DATE 0
FUNCTION MODULE-FORMATTED-DATE 0
FUNCTION MODULE-ID 0
FUNCTION MODULE-PATH 0
FUNCTION MODULE-SOURCE 0
FUNCTION MODULE-TIME 0
FUNCTION MONETARY-DECIMAL-POINT 0
FUNCTION MONETARY-THOUSANDS-SEPARATOR 0
FUNCTION NATIONAL-OF Variable
FUNCTION NUMERIC-DECIMAL-POINT 0
FUNCTION NUMERIC-THOUSANDS-SEPARATOR 0
FUNCTION NUMVAL 1
FUNCTION NUMVAL-C 2
FUNCTION NUMVAL-F 1
FUNCTION ORD 1
FUNCTION ORD-MAX Variable
FUNCTION ORD-MIN Variable
FUNCTION PI 0
FUNCTION PRESENT-VALUE Variable
FUNCTION RANDOM Variable
FUNCTION RANGE Variable
FUNCTION REM 2
FUNCTION REVERSE 1
FUNCTION SECONDS-FROM-FORMATTED-TIME 2
FUNCTION SECONDS-PAST-MIDNIGHT 0
FUNCTION SIGN 1
FUNCTION SIN 1
FUNCTION SQRT 1
FUNCTION STANDARD-COMPARE Variable
FUNCTION STANDARD-DEVIATION Variable
FUNCTION STORED-CHAR-LENGTH 1
FUNCTION SUM Variable
FUNCTION TAN 1
FUNCTION TEST-DATE-YYYYMMDD 1
FUNCTION TEST-DAY-YYYYDDD 1
FUNCTION TEST-FORMATTED-DATETIME 2
FUNCTION TEST-NUMVAL 1
FUNCTION TEST-NUMVAL-C 2
FUNCTION TEST-NUMVAL-F 1
FUNCTION TRIM 2
FUNCTION UPPER-CASE 1
FUNCTION VARIANCE Variable
FUNCTION WHEN-COMPILED 0
FUNCTION YEAR-TO-YYYY Variable
======================================== ==========
GnuCOBOL 补充道
======================================== ==========
FUNCTION CONCATENATE Variable
FUNCTION SUBSTITUTE Variable
FUNCTION SUBSTITUTE-CASE Variable
======================================== ==========
除非 source(或编译时选项)包含,否则关键字 FUNCTION
是必需的
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
REPOSITORY.
FUNCTION ALL INTRINSIC.
ALL INTRINSIC
可以是 PROCEDURE DIVISION
语句中没有 FUNCTION
前缀的函数列表。
LENGTH
函数具有已排序的历史记录。有些编译器包含一个 LENGTH
保留字。对于 GnuCOBOL,此保留字仅在短语 LENGTH OF
中使用时才被识别,OF
令牌需要消除该功能与较旧的保留字扩展名的歧义。