Within COBOL, there is support for a single source file to contain more than one complete program. If your program utilizes
user-defined functions, these too must be coded within the same file.
When you compile a project that contains a multi-program source file, that source file generates a number of artifacts depending
on the target type of the project. The following section details how to set the main execution entry point for one of these
files, depending on the target type:
- All Int/Gnt Files
- Each program within a multi-program source file produces a symbols file (.idy file) and an intermediate file (.int file). The main entry point for the final executable can be specified in the
main program field of the build configuration.
- Single Executable File or Single Native Library File
- All programs within a multi-program source file are compiled into a single executable or library file, using the name of
the project. The main entry point for the final executable/library can be specified in the
main program field of the build configuration.
- All Executable Files or All Native Library Files
- Each source file compiles to an individual executable or library. For a multi-program source file, all programs are compiled
into a single executable or library file (as above), but the main entry point is specified within the source file's properties:
- In COBOL Explorer, right-click the source file and select
Properties.
- From the
Properties dialog box, select
Link, select
Enable file specific settings, and then edit the value of the
Entry point field to the name of the required program.