End program, end class, and end method markers

The end markers are a combination of words followed by a separator period that indicates the end of a COBOL program, method, class, factory, or object definition.

For example:


END PROGRAM program-name.
END CLASS class-name.
END METHOD "method-name".
END OBJECT.
END FACTORY.
For programs
program-name must be identical to the program-name of the corresponding PROGRAM-ID paragraph. Every COBOL program, except an outermost program that contains no nested programs and is not followed by another batch program, must end with an END PROGRAM marker.
For classes
class-name must be identical to the class-name in the corresponding CLASS-ID paragraph.
For methods
method-name must be identical to the method-name in the corresponding METHOD-ID paragraph.
For object paragraphs
There is no name in an object paragraph header or in its end marker. The syntax is simply END OBJECT.
For factory paragraphs
There is no name in a factory paragraph header or in its end marker. The syntax is simply END FACTORY.