內在函式
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
令牌需要消除該功能與較舊的保留字副檔名的歧義。