Tailored to Needs

Call Us: 01225 339705 Email: This email address is being protected from spambots. You need JavaScript enabled to view it. Address: Verhoef Training, 11 Kingsmead Square, Bath, BA1 2AB

  • Register


This intermediate course is perfect for application programmers who need to write embedded SQL COBOL or PL/I programs in either a DB2 9 or DB2 10 for z/OS environment.

Note: An updated version of this course (for DB2 11) is also available, see CV722G.


Delegates should already have experience with one of the supported programming languages, COBOL or PL/I for z/OS, and be able to construct and use SQL statements.


3 days.


Through this course, attendees with acquire the skills necessary to produce application programs that manipulate DB2 databases. Emphasis is on embedding Structured Query Language (SQL) statements and preparing programs for execution.

Course objectives include:

  • Incorporate static SQL statements in an application program.
  • Prepare the program for execution.
  • Validate execution results are correct.
  • Produce code to support multiple rows being returned from the database manager using cursors.
  • Identify considerations regarding units of work, concurrency, and restart of programs.
  • Identify differences between static and dynamic SQL.
  • Provide test data for applications.
  • Discuss program and DB2 options relative to performance of static SQL.


DB2 Concepts:
Identify DB2 family products.
Explain DB2 workstation component functions.
Identify DB2 objects.
Identify the key differences between static SQL and other application alternatives for accessing DB2 data.

Program Structure I:
Embed INSERT, UPDATE, DELETE and single-row SELECT statements in application programs.
Effectively communicate with DB2 when processing NULL values and determining success of statement execution.
Demonstrate use of DB2 coding aids.
Code CONNECT statements within an application program.
Identify connection types and impacts on a unit of work.
Program for the Call Attach Facility (CAF).

Program Preparation:
Identify the additional steps necessary to prepare a program that contains embedded SQL for execution.
Describe the functions of the DB2 PRECOMPILE and BIND processes.
Describe factors relevant to the BIND process, including RUNSTATS positioning, package status, parameters, and authorization requirements.

Program Structure II:
Use DECLARE, OPEN, FETCH and CLOSE CURSOR statements to handle select criteria that may return multiple rows in application programs.
Issue positioned UPDATE and DELETE statements.
Identify how scrollable cursors can be used.

Recovery and Locking Concepts:
Define a unit of recovery.
Identify the basic locking strategies used by DB2.

Dynamic SQL Introduction:
Describe the difference between static and dynamic SQL.
List the types of dynamic statements.
Code dynamic SQL in a program.

Managing Test Data:
Identify methods to insert data into a table.
Use the LOAD or IMPORT utility.
Identify the purpose of the RUNSTATS utility.
Identify the purpose of the REORG utility.

Performance Considerations:
Use programming techniques that enhance DB2 application performance by following general guidelines, using indexable predicates and avoiding unnecessary sorts.
Identify the access paths available to DB2.
List common causes of deadlocks and avoid such causes when possible.
Use the EXPLAIN tools as aids to develop applications that emphasize performance.

S5 Box