700 likes | 965 Views
DB2. Session Plan. Precompilation DBRM Binding Application Plan and Package Program preparation summary Demonstration of batch application in different modes Working with CICS. Steps Involved in Program Preparation. Pre-compilation Binding Compilation Linking Execution.
E N D
Session Plan • Precompilation • DBRM • Binding • Application Plan and Package • Program preparation summary • Demonstration of batch application in different modes • Working with CICS
Steps Involved in Program Preparation • Pre-compilation • Binding • Compilation • Linking • Execution
Precompilation Involves the following sequence of events. • Syntax checking of SQL statements embedded in the host language. • Checking for datatype matches. • Commenting out the SQL statements and replacing it with equivalent COBOL CALL statements. • Creation of DBRM (Data base Request Module).
DBRM (Data base Request Module) • A DBRM is a module containing SQL statements. • A DBRM is stored as a member of a PDS.
Binding • Converts all the SQL statements to executables • Bind reads SQL statements from DBRM’s and produces a strategy to access data directed by the SQL statements. • Does the following • Checks the syntax SQL statements • Verification of authority on DB2 objects • Optimization of SQL statements to create the application plan
Application Plan • Is the executable form of one or more of one or more DBRMs and application package • Should be generated every time a DBRM is modified. • Application plans are kept in the buffer pool during program execution
Application Package • Is the executable form of a single DBRM. • Is bound to an application plan with related packages. • If any DBRM is altered, then only the corresponding package needs re-binding.
Relationship between DBRM, Package and Plan PLAN PACKAGE PACKAGE PACKAGE DBRM4 DBRM1 DBRM2 DBRM3
Source Program DBRM Modified Source program Packages Plans Load Module Program Preparation Summary Hostvariables copybook DCLGEN Precompile Catalog Tables Plans & packages Info DB Objects Info BIND Bufferpool Compile & Link Execution
Demonstration Program Preparation and Execution
Execution in Foreground Mode
Execution in EDITJCL Mode
Execution in BACKGROUND Mode