FUNCTION-ID paragraph
The FUNCTION-ID paragraph specifies the name by which a user-defined function or function prototype is known and assigns selected attributes to that function or function prototype. The FUNCTION-ID paragraph is required and must be the first paragraph in the IDENTIFICATION DIVISION.
The following format is for a function IDENTIFICATION DIVISION.
The following format is for a function prototype
definition.
- function-name-1 or function-prototype-name-1
- A user-defined word, but not a figurative constant, that identifies your function or function prototype. It must follow the following rules of formation:
- The name can be up to 30 characters in length.
- The name cannot be a figurative constant.
- Only the hyphen, underscore, digits 0-9, and alphabetic characters are allowed in the name.
- At least one character must be alphabetic.
- A hyphen cannot be the first or last character.
- literal-1
-
- If literal-1 is specified, literal-1 is an alphanumeric
literal providing the externalized name of the function or function prototype
to the operating environment. It may not be a figurative constant.
The externalized name depends on literal-1 and the PGMNAME option. If literal-1 is specified, all suboptions of the PGMNAME option are allowed and apply to literal-1 and do not apply to function-name-1 and function-prototype-name-1.
- If literal-1 is not specified, the PGMNAME(COMPAT) and PGMNAME(LONGUPPER) compiler options are allowed and apply to function-name-1 for function definitions, or function-prototype-name-1 for prototype definitions. The PGMNAME(LONGMIXED) compiler option, in this case, is not allowed.
- If literal-1 is specified, literal-1 is an alphanumeric
literal providing the externalized name of the function or function prototype
to the operating environment. It may not be a figurative constant.
- ENTRY-INTERFACE
- ENTRY-INTERFACE controls the type of generated code for an invocation to this user-defined function or function prototype. The default is STATIC.
- ENTRY-NAME
- ENTRY-NAME provides an override of the PGMNAME compiler option for this user-defined function or function prototype.