TITLE statement

The TITLE statement specifies a title to be printed at the top of each page of the source listing produced during compilation.

If no TITLE statement is found, a title containing the identification of the compiler and the current release level is generated. The title is left-justified on the title line.

Format

Read syntax diagramSkip visual syntax diagramTITLEliteral.
literal
Must be an alphanumeric literal, DBCS literal, or national literal and can be followed by a separator period.

Must not be a figurative constant.

In addition to the default or chosen title, the right side of the title line contains the following items:

  • For programs, the name of the program from the PROGRAM-ID paragraph for the outermost program. (This space is blank on pages preceding the PROGRAM-ID paragraph for the outermost program.)
  • For classes, the name of the class from the CLASS-ID paragraph.
  • Current page number.
  • Date and time of compilation.

The TITLE statement:

  • Forces a new page immediately, if the SOURCE compiler option is in effect
  • Is not itself printed on the source listing
  • Has no other effect on compilation
  • Has no effect on program execution
  • Cannot be continued on another line
  • Can appear anywhere in any of the divisions

A title line is produced for each page in the listing produced by the LIST option. This title line uses the last TITLE statement found in the source statements or the default.

The word TITLE can begin in either Area A or Area B.

The TITLE statement must be embedded in a class or program source. For example, in the case of batch applications, the TITLE statement must be placed between the PROCESS (CBL) statement and the end of the program (or the END PROGRAM marker, if specified).

No other statement can appear on the same line as the TITLE statement.