How the DB2 application program runs on mainframe environment.

Step by Step process of how the DB2 Application program(Cobol + DB2) works on mainframe.(Also explain the concept of precompilation timestamp)

What is DB2 Application program?

The program written in any High-Level language (In this context COBOL language) which access the data stored in DB2 database.


IF we feed the DB2 application program written in COBOL to the Cobol Compiler (IGYCRCTL) it can recognize only Cobol statements in application program and cannot recognize any DB2 statement hence before feeding this program directly to Cobol compiler, we want something which can recognize DB2 statement and separate the DB2 statement from the Cobol program. This can be done by feeding the application program to DB2 Pre-compiler.




DB2 Pre-compiler :

•The DB2 pre-compiler will comment out the DB2 statement in program and replace them with the CALL statement.

•The DB2 pre-compiler will comment out the DB2 statement in program and replace them with the CALL statement.


This commented DB2 statement will be stored separately in different dataset which is called as DBRM (Data Base Request Module).

So this pre-compiler separates out the main program in two parts

1>The modified Source code (The main program with Commented Db2 statements and corresponding replaced CALL statement)

2>The DBRM (Contains all the DB2 statement from the source program)


•Place the timestamp token on DBRM and modified source code .This
Timestamp token will then carry forward in both parts and will be checked at the run time when these two separated parts reunite.
So at the run time the matching timestamp token will indicate that we are using the same DBRM and Modified source code which get separated at pre-compile step.

The pre-compilation timestamp token placed by DB2 pre-compiler on the DBRM can be obtained by checking the value from POS 25 through POS 32 in the DBRM header, which is the first record in the DBRM member.

CONTINUE...

Widget By Devils Workshop

About This Blog