Compilation Process (COBOL + CICS)
Now a days, the most frequently used technologies in CICS application programs are COBOL, CICS and DB2. The technologies like IMS DB/DC are very rarely used in old projects that are not migrated to DB2.
So in this chapter, we will discuss about COBOL CICS DB2 application program compilation process.
Before going through the CICS COBOL DB2 compilation process, go through the COBOL DB2 pre-compilation process here to get a basic idea about compilation process.
Apart from the pre-compilation process, there one more additional step added to the compilation called as “CICS Translation” for the CICS application program with COBOL CICS DB2.
Below diagram shows the steps for CICS compilation process –
What a Precompiler can do?
Precompiler separates the DB2 statements from the other language statements of the source program. The DB2 statements should be coded with embedded SQL statements(EXEC SQL) to recognize by the precompiler because most compilers do not recognize SQL statements.
DB2 precompiler must be coded before the compilation step of the program to prevent compiler errors. The DB2 precompiler converts EXEC SQL commands into comments and generates appropriate CALL statements.
The precompiler scans the program and returns the modified source code. The DB2 precompiler separates SQL statements from C, COBOL, Fortran, PL/I and Assembler languages before compilation.
The main output from the precompiler is a database request module (DBRM). A DBRM is a data set that contains SQL statements and host variable information that is extracted from the source program during program precompilation. The purpose of a DBRM is to communicate SQL requests to DB2 during the bind process.
What a CICS translator can do?
CICS integrated translator can translate and compile CICS source code in a single step. Compilers that support the integrated translator scans the application source code and call the integrated translator at relevant points.
The integrated translator converts EXEC CICS commands into comments and generates CALL statements appropriate to the language. The integrated translator versions available for the languages - C, C++, COBOL and PL/I.
Application development is faster with the integrated translator because there is no separate translation step required. The generated listing contains the original source statements and the CICS error messages that are included in the compiler listing.
The supplied separate translators change the line numbers in source programs with translator-generated calls that are used when debugging an application program.
With the integrated translator, the process of translating and compiling is less error-prone because it is not necessary to translate included members separately. The language compiler releases support the integrated translator are listed in High-level language support.
What a Compiler can do?
Compilation is a important process of converting high level program code (COBOL) to low level code. The low-level language code is a machine level language that only a machine can understand.
This is one of the most important phases of programming development life cycle. The compiler compiles the source program into an object module.
If necessary, it gets the copy members needed for the compilation from the specified copy libraries. During compilation, the compiler produces output that can be printed or displayed on the terminal or monitor.
What a Linkage Editor can do?
The linkage editor links the object program with any subprograms called from it and also creates the executable component for the program. The linkage editor creating an executable component for the program called a load module.
The linkage editor links the object program with one or more system subprograms. However, it can also link it with COBOL subprograms. The Link edit step takes the Object module created by compilation step as input and link edits it to create the final load file.