The precompiler "prepares" the source program for compilation by replacing each EXEC SQL statement with a language-specific CALL statement and placing the SQL text in comment. (DB2 is not accessed during this process.) The precompiler can be invoked in DB2I or in batch and

  • Includes the DCLGEN member as specified and the SQLCA

  • Looks for SQL statements and for host-variable definitions

  • Verifies the SQL syntax

  • Matches each column and table name in the SQL to the DECLARE TABLE statements

  • Prepares the SQL for compilation or assembly in the host language

  • Produces a DBRM and stores it in a partitioned data set (PDS)

The DBRM that is created contains extracted, somewhat modified, parsed SQL source code that can be stored as a member in a PDS. One DBRM is created for each precompiled source program, and it will then become the input to the BIND process.

The SQL statements are replaced during the precompile process with a call to the DSNHLI module. This call will contain the necessary parametersDBRM name, timestamp, statement number, address of host variables, and address of SQLCAin order to locate the access path needed to execute the SQL statement associated with the call when the DBRM and modified source are used together at execution time.

DB2 for z. OS Version 8 DBA Certification Guide
DB2 for z/OS Version 8 DBA Certification Guide
ISBN: 0131491202
EAN: 2147483647
Year: 2003
Pages: 175
Authors: Susan Lawson © 2008-2017.
If you may any questions please contact us: