HP 3000 Manuals

END PROGRAM Header [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

END PROGRAM Header 

The  END PROGRAM header is a feature of the 1985 ANSI COBOL standard

The END PROGRAM header indicates the end of the named COBOL program.  It
must begin in Area A.

Syntax 

     END PROGRAM program-name.

Description 

The following rules should be observed when using the END PROGRAM header:

   *   The program-name must be identical to the program-name declared in
       the preceding PROGRAM-ID paragraph.  In a nested program, the END
       PROGRAM header for the contained program must precede the END
       PROGRAM header for the containing program.

   *   It must be present in every program which either contains or is
       contained within another program.

   *   If the program being terminated by the END PROGRAM is contained
       within another program, the next statement must be either the
       IDENTIFICATION DIVISION header or another END PROGRAM header to
       terminate the containing program.

   *   If the program terminated by the END PROGRAM header is not a
       contained program and if the next statement is a COBOL statement,
       it must be an IDENTIFICATION DIVISION header for the following
       COBOL program.  These types of programs are called concatenated
       programs.

If the END PROGRAM header is not followed by correct program name, the
compiler will issue an error message.



MPE/iX 5.0 Documentation