COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
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.
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
Default:
program, the compiler reports this as an error, compiles the first qualifying program
unit as the main program, and produces multiple object files.
Before the Identification Division header of the first program unit in the compilation
unit.
Placement:
Applies to the program that contains itScope:
NoneDependencies:
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.
MAP and NOMAP
MAP
lists a symbol table listing, which appears after the source program listing for the program unit
(see Symbol Table Listing (page 776)).
NOMAP
suppresses the symbol table listing.
NOMAPDefault:
AnywherePlacement:
The last MAP or NOMAP applies.Scope:
MAP works only if LIST is active and SUPPRESS is not.Dependencies:
References:
• LIST and NOLIST
• SUPPRESS and NOSUPPRESS
Compiler Directives 557










