COBOL Manual for TNS/E Programs (H06.03+)

Data Division
HP COBOL Manual for TNS/E Programs520347-003
7-41
Absent Linkage Section
Absent Linkage Section
If there is no Linkage Section in the called program, it looks like a main program to the
compiler. If you compile a main program and a subprogram with no parameters in the
same compilation session, you must include either a MAIN directive or an empty
Linkage Section to tell the compiler which program is the main one (see Main
Programs). If you do neither, the compiler reports that it found two main programs.
Because the compiler interprets subprograms that have no parameters as main
programs, if you want to compile a collection of such subprograms, you need to direct
the compiler not to attempt to give any of them the main attribute. To do this, use a
MAIN directive specifying a program-name that does not correspond to the name of
any program in the compilation.