4.14 PROGRAM Statement

The PROGRAM statement associates a symbolic name with a main program unit. It takes the following form:

PROGRAM nam
nam
Is the symbolic name of a source file.

Rules and Behavior

The PROGRAM statement is optional. The default name for a main program unit is filename$MAIN, where filename is the name of your source file. If filename is larger than 26 characters and a name is not specified in a PROGRAM or BLOCK DATA statement, the name is truncated to 26 characters and $MAIN is appended to form the program name.

If you use the PROGRAM statement, it can be preceded only by comment lines or an OPTIONS statement. Otherwise, it must come first in the main program.

The program unit's symbolic name cannot be the name of any entity within the main program or the name of any subprogram or entry point in the same executable program.


Previous Page Next Page Table of Contents