Types of functions
The topic introduces types of functions in COBOL.
COBOL has the following types of functions:
- Alphanumeric
- National
- UTF-8
- Numeric
- Integer
Alphanumeric functions are of class and category alphanumeric. The value returned has an implicit usage of DISPLAY. The number of character positions in the value returned is determined by the function definition.
National functions are of class and category national. The value returned has an implicit usage of NATIONAL and is represented in national characters (UTF-16). The number of character positions in the value returned is determined by the function definition.
UTF-8 functions are of class and category UTF-8. The value returned has an implicit usage of UTF-8 and is represented in UTF-8 characters (UTF-8). The number of character positions in the value returned is determined by the function definition.
Numeric functions are of class and category numeric. The returned value is always considered to have an operational sign and is a numeric intermediate result. For more information, see Using numeric intrinsic functions in the Enterprise COBOL Programming Guide.
Integer functions are of class and category numeric. The returned value is always considered to have an operational sign and is an integer intermediate result. The number of digit positions in the value returned is determined by the function definition. For more information, see Using numeric intrinsic functions in the Enterprise COBOL Programming Guide.