Start of change

FUNCTION-ID paragraph

Start of changeThe 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.End of change

Start of changeThe following format is for a function IDENTIFICATION DIVISION.End of change

Format: function identification division

Read syntax diagramSkip visual syntax diagramIDENTIFICATIONIDDIVISION.FUNCTION-ID.function-nameAS'‚ÄČliteral-1'.AUTHOR.comment-entryINSTALLATION.comment-entryDATE-WRITTEN.comment-entryDATE-COMPILED.comment-entrySECURITY.comment-entryENTRY-INTERFACE.comment-entryENTRY-NAME.comment-entry
Start of changeThe following format is for a function prototype definition.

Format: function prototype identification division

Read syntax diagramSkip visual syntax diagramIDENTIFICATIONIDDIVISION.FUNCTION-ID.function-prototype-name-1AS'‚ÄČliteral-1'ISPROTOTYPEENTRY-INTERFACEISSTATICDYNAMICDLLENTRY-NAMEISCOMPATLONGUPPERLONGMIXED.
End of change
function-name-1 or Start of changefunction-prototype-name-1End of change
A user-defined word, but not a figurative constant, that identifies your function Start of changeor function prototypeEnd of change. It must follow the following rules of formation:
  • The name can be up to 30 characters in length.
  • Start of changeThe name cannot be a figurative constant.End of change
  • 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 Start of changeor function prototypeEnd of change to the operating environment. It may not be a figurative constant.

    Start of changeThe 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. End of change

  • Start of changeIf 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. End of change
Start of changeFor more information about the PGMNAME option, see PGMNAME in the Enterprise COBOL Programming Guide.End of change
Start of changeENTRY-INTERFACEEnd of change
Start of changeENTRY-INTERFACE controls the type of generated code for an invocation to this user-defined function or function prototype. The default is STATIC.End of change
Start of changeENTRY-NAMEEnd of change
Start of changeENTRY-NAME provides an override of the PGMNAME compiler option for this user-defined function or function prototype.End of change
End of change