COBOL Manual for TNS and TNS/R Programs

Program Compilation
HP COBOL Manual for TNS and TNS/R Programs522555-006
11-98
MAIN
MAIN
MAIN identifies the main program unit.
program-name
is the program-name (specified in the PROGRAM-ID paragraph) of the program
that is the main entry point of the target file being produced by the compilation.
When MAIN appears, only the program unit indicated (the one beginning with a
PROGRAM-ID paragraph that specifies the same program-name) is compiled as a
main program. All other program units in the compilation unit are compiled as called
programs, whether or not they include a Linkage Section.
If no PROGRAM-ID paragraph in the compilation unit specifies the same program-
name as that specified in MAIN, the compiler reports that the resulting target file has
no main program. It is therefore not executable.
Default: Every program unit that does not have a Linkage Section is compiled as
a main program. If more than one program unit of a compilation unit
qualifies as a main program, the compiler reports this as an error,
compiles the first qualifying program unit as the main program, and
produces multiple object files.
Placement: Before the Identification Division header of the first program unit in the
compilation unit.
Scope: Applies to the program that contains it
Dependencies: None
MAIN program-name
VST294.vsd