To compile the application:
The Output window displays information about the progress of the build result
The build checks for any files that have changed and does two things:
The Micro Focus COBOL Compiler can compile many different COBOL dialect variations. It can also compile COBOL code that contains EXEC CICS or EXEC SQL statements. The Compiler is controlled through a series of "directives" which are passed to the Compiler at build time. You can set directives at either a project or component level.
Often the directives can be set only at the project level, which means that all component files in the project use them. Sometimes, you have a component which you need to compile with different directives. In this case, you can set the directives at the component level which overrides the project settings.
For example, most of the programs in your project could be using Enterprise COBOL for z/OS and only a few could use VS COBOL II. In this case, you would set directives for Enterprise COBOL for z/OS at the project level, and VS COBOL II at the respective COBOL programs.
The Bankdemo application already has the required Compiler directives set on the files. At build time, the IDE invokes the COBOL compiler to compile the sources and create a number of files. These "built" files can vary, but each COBOL program in the Bankdemo application compiles to produce the following three types of file:
File type | Function |
---|---|
.dll - dynamic link library | Effectively the executable module the Compiler creates for each program. |
.idy - debugger information | The file created by the Compiler which allows debugging of the module. |
.obj - object file | A temporary file the Compiler creates while producing the .dll. You can delete these files. |
In the same way as for COBOL, the BMS compilation is controlled both at project and at component level.
The BMS Compiler produces the following two types of file:
File type | Function |
---|---|
.mod - BMS executable | A file created by the BMS compiler which is the executable module relating to the BMS source. |
.cpy - copybook | A copybook that contains the BMS mapping for use in a COBOL program. |
You can configure the IDE to create a fully expanded Compiler listing file during the build. The following is also an example of setting a directive at component level:
During the build, the Compiler produces a source listing file, ZBNKPRT1.lst, in a Listing subfolder in the project directory (C:\MFETDUSER\Bankdemo\Projects\Studio\Bankdemo\Listing in this case). The listing file includes a fully expanded source file together with some Compiler system information at the start and with any Compiler errors highlighted with asterisks. From Windows Explorer, you can open the file in a text editor such as Microsoft's Notepad and view its contents.
You can introduce some Compiler errors into one of the programs to see how the Compiler handles them:
The errors are underlined with red wavy lines and a colored bar is added to the left of each line that includes an error.
The lines that include syntax errors are marked with asterisks (**).
There should be no errors in the build now.