Built-in functions and subroutines are procedures provided by the Open PL/I language. They can be used wherever an expression is valid.
The built-in functions and subroutines provided by Open PL/I can be grouped into the following classes:
- Arithmetic built-in functions, which provide information about the properties of arithmetic values, or that perform ordinary arithmetic calculations. These include:
ABS
|
EXP
|
LOG10
|
MOD
|
SIGN
|
ADD
|
FLOOR
|
LOG2
|
MULTIPLY
|
SORT
|
CEIL
|
INT
|
MAX
|
POSINT
|
TRUNC
|
DIVIDE
|
LOG
|
MIN
|
ROUND
|
|
- Trigonometric built-in functions, which perform standard mathematical calculations in floating-point. These include:
ACOS
|
ATAND
|
COSD
|
SIND
|
TAND
|
ASIN
|
ATANH
|
COSH
|
SINH
|
TANH
|
ATAN
|
COS
|
SIN
|
TAN
|
|
- String built-in functions, which process character-string and bit-string values. These include:
BOOL
|
HIGH
|
LOW
|
SUBSTR
|
VALID
|
COLLATE
|
INDEX
|
REPEAT
|
TRANSLATE
|
VERIFY
|
COPY
|
LENGTH
|
STRING
|
TRIM
|
|
- Conversion built-in functions, which convert data from one data type to another. These include:
BINARY
|
BYTE
|
DECIMAL
|
FLOAT
|
RANK
|
BIT
|
CHARACTER
|
FIXED
|
|
|
- Condition-handling built-in functions, which provide information about interrupts that are caused by signaled conditions. These include:
ONCHAR
|
ONFILE
|
ONKEY
|
ONLOC
|
ONSOURCE
|
ONCODE
|
|
|
|
|
- Array-handling built-in functions, which provide information about arrays and array elements. These include:
ALL
|
DIMENSION
|
LBOUND
|
PROD
|
SUM
|
ANY
|
HBOUND
|
|
|
|
- Storage-handling built-in functions, which provide information on the storage requirements and location of variables. These include:
ADDR
|
CURRENTSTORAGE
|
OFFSET
|
SIZE
|
STORAGE
|
ALLOCATION
|
NULL
|
POINTER
|
|
|
- Miscellaneous built-in functions and subroutines. These include:
DATE
|
LINENO
|
PLIRETV
|
PLITEST
|
TIME
|
DATETIME
|
PAGENO
|
PLISRTx
|
RESIGNAL
|
UNSPEC
|
FLUSH
|
PLIRETC
|
|
|
|
- Built-in character-handing functions which accept or return WIDECHAR character-type only.
WIDECHAR / WCHAR
|
WCHARVAL
|
WHIGH
|
WLOW
|
|
- Built-in character-handing functions which accept WIDECHAR arguments where character-type arguments apply; when the return value is a character-string the return type is WIDECHAR if any WIDECHAR arguments are passed.
LEFT
|
RIGHT
|
CENTERLEFT / CENTRELEFT
|
CENTERRIGHT / CENTRERIGHT
|
CHARACTER / CHAR
|
COPY
|
INDEX
|
LENGTH
|
MAXLENGTH
|
RANK
|
REPEAT
|
REVERSE
|
SEARCH
|
SEARCHR
|
SUBSTR
|
TALLY
|
TRIM
|
UNSPEC
|
VERIFY
|
VERIFYR
|
This chapter describes each built-in. The built-ins are presented in alphabetical order by name. Each built-in definition consists of the following subsections: syntax, description (the effect of the built-in), examples (one or more examples of the built-in usage and results) and restrictions (any restrictions in the use of the built-in).
Arguments to built-ins are effectively passed by value, that is, no alteration of the arguments is done.