Go BackDB2: Program Development and Efficiency

Synopsis
DB2: Program Development and Efficiency covers the interactive tools available for program development, methods to prevent failures and invalid updates, and hints on minimizing the overhead in accessing tables.

Audience
This course is designed for COBOL programmers who want to use SQL in their programs to access data in DB2 tables.

Time
3 - 5 hours

Product Code: DB2114
After completing this course, the student should be able to:
 
Explain program development and preparation, including the use of SPUFI and DCLGEN
Discuss error recovery practices and potential errors due to concurrent users
Describe various considerations for program performance

Program Preparation and Support
Introduces the interactive tools available to support the preparation and testing of SQL statements and COBOL programs containing SQL.
 
Overview of Program Development

Overview of the steps in developing, preparing and testing a COBOL program that includes SQL statements.  DB2 tools available to carry out those steps.
 
SPUFI

Interactive testing of queries.  Data sets where queries are stored.  ISPF EDIT to enter and modify queries.  Processing options available.  Creation and contents of the output file.
 
DCLGEN

Creation of the DECLARE TABLE statement and host variables via DCLGEN.  Use of DB2I's Primary Option Menu to run DCLGEN.  Use of the DSN command to run DCLGEN.  Batch or background jobs to run DCLGEN.
 
Program Preparation

Evaluating and compiling SQL code.  Establishing a link to DB2.  Purpose of the precompile stage.  The bind process to create packages and plans.  DB2I, JCL or the DSNH CLIST to prepare and run a program.

Data Integrity and Program Efficiency
Covers issues such as preventing invalid updates and recovering from program failure.  The final lesson gives some hints on how to code programs to minimize the overhead in accessing tables.
 
Error Recovery

Committing updates at task completion.  Rollback of updates since the last commit point.  Definition of a unit of recovery.  DB2's automatic committing of updates.  Purpose and use of the SQL COMMIT statement.  Purpose and use of the CICS commands CICS RETURN and CICS SYNCPOINT.  Use of IMS checkpoints.  Implicit and explicit methods to cause the rollback of updates.  Automatic closing of the cursor at commit points.
 
Concurrent Users

Definition of locking.  Types of isolation levels.  Where to specify the level of isolation.  Locksize at table creation time.  Options that affect concurrency.
 
Program Performance

How program performance is affected by program design, table definition, SQL syntax, use of an index by DB2, the EXPLAIN statement and sorting.

 

Go Back