Function
END markers indicate the end of a known source unit, where a source unit is a sequence of statements that begins with an Identification Division and ends with an END marker.
Format
END { PROGRAM program-prototype-name-1
| PROGRAM program-name-1
| CLASS class-name-1
| FACTORY
| OBJECT
| METHOD [method-name-1]
| INTERFACE interface-name-1
}.
Syntax rules
An END marker must be present in every source unit that contains, is contained in, or precedes another source unit.
If a PROGRAM-ID paragraph for program-name-2 is stated between a PROGRAM-ID paragraph for program-name-1 and its associated END marker, then the END marker for program-name-2 must precede the END marker for program-name-1.
program-name-1 must be identical to the program name declared in the PROGRAM-ID paragraph of the program to which the END marker refers.
class-name-1 must be identical to the class name declared in the corresponding CLASS-ID paragraph.
method-name-1 must be identical to the method name declared in the corresponding METHOD-ID paragraph.
interface-name-1 must be identical to the interface name declared in the corresponding INTERFACE-ID paragraph.
program-prototype-name-1 must be identical to one of the program prototype names declared in the corresponding PROGRAM-ID paragraph.