DBRM
Database request module: the SQL taken out of a program when it is prepared, which is then bound into a DB2 package.
Also written database request module, precompile, DB2 precompiler, DB2 coprocessor, consistency token
A COBOL program with embedded SQL cannot simply be compiled, because the COBOL compiler does not run SQL. The SQL has to be separated out. That step produces a DBRM, a database request module, which contains the program's SQL statements.
The separation is done by the DB2 precompiler, or by the DB2 coprocessor built into the compiler. The program's EXEC SQL statements are replaced with calls to DB2, and the SQL goes into the DBRM. The program is then compiled and link-edited as normal, and the DBRM is bound into a package, where DB2 decides how to run each statement.
Both the load module and the package carry the same consistency token, a kind of timestamp. When the program runs, DB2 checks that they match. If the program was compiled again but not bound, or bound from a different version, they will not match, and the SQL fails with SQLCODE -805 or -818.
That is why compile, link-edit and bind are done together, usually by the source code manager, so the parts always stay in step.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- BINDPreparing a program's SQL for execution, working out how each statement will access the data and storing the result.
- Embedded SQLSQL statements written directly inside a COBOL program, marked off so they can be prepared before compiling.
- CompileTurning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.
- Load moduleThe runnable form of a program, stored in a library, which JCL executes by name.
- DB2 for z/OSIBM's relational database on the mainframe, where a great deal of the world's banking and insurance data is stored.
- DCLGENA tool that generates COBOL declarations matching a DB2 table, so the program's fields line up with the columns.