COBOL - Intrinsic Function
Intrinsic function is a function that performs a mathematical, character, or logical operation, and thereby allows you to make reference to a data item whose value is derived automatically during execution.
The functions can be grouped into six categories, based on the type of service performed:
-
Mathematical
-
Statistical
-
Date/time
-
Financial
-
Character-handling
-
General
You can reference a function by specifying its name, along with any required arguments, in a procedure division statement.
Functions are elementary data items, and return alphanumeric character, national character, numeric, or integer values. Functions cannot serve as receiving operands.
The general format of a function
FUNCTION function-name (argument)
|
Where,
function-name - It must be one of the intrinsic function names.
argument - It must be an identifier, a literal (other than a figurative constant), or an arithmetic expression that satisfies the argument requirements for the specified function.
Let us see some of the important intrinsic functions in next chapter...
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!