Chapter 7 Further Reading

IBM Official Documentation

DB2 for z/OS SQL Reference

  • Multi-row FETCH: DB2 13 for z/OS SQL Reference, Chapter 6: "FETCH statement" — covers the FOR n ROWS syntax, NEXT ROWSET positioning, and SQLERRD(3) semantics. This is the definitive reference for multi-row FETCH behavior including edge cases not covered in this chapter.
  • Multi-row INSERT: Same volume, Chapter 6: "INSERT statement" — covers FOR n ROWS, ATOMIC and NOT ATOMIC modes, and the behavior of SQLERRD fields for partial success.
  • MERGE statement: Same volume, Chapter 6: "MERGE statement" — covers the complete syntax including conditional UPDATE/INSERT logic, signal conditions, and the DATA CHANGE TABLE reference option.

DB2 for z/OS Temporal Tables

  • IBM Redbook SG24-8317: Temporal Data Management with DB2 for z/OS — the comprehensive guide to system-period, application-period, and bi-temporal table design. Includes performance benchmarks, migration strategies, and real-world case studies. Essential reading before implementing temporal tables in production.
  • DB2 13 for z/OS Administration Guide: Chapter on "Managing temporal data" — covers DDL requirements, versioning activation, history table management, and partition rotation strategies.

DB2 for z/OS OLAP Functions

  • DB2 13 for z/OS SQL Reference: Chapter 4: "OLAP specifications" — covers ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, NTILE, and all aggregate functions with OVER clauses. Pay particular attention to the window frame specification syntax (ROWS vs. RANGE, BETWEEN clauses).
  • IBM Redbook SG24-8126: DB2 for z/OS: Data Sharing in a Nutshell — while focused on data sharing, includes a chapter on OLAP function performance in shared environments.

Recursive CTEs

  • DB2 13 for z/OS SQL Reference: Chapter 5: "Common table expressions" — covers both non-recursive and recursive CTEs, including cycle detection strategies, depth limiting, and EXPLAIN behavior.

Books

COBOL-DB2 Programming

  • Mullins, Craig S. DB2 Developer's Guide, 6th Edition (2012). Despite its age, this remains the most comprehensive single-volume reference for DB2 application programming. Chapters on embedded SQL, cursor processing, and performance tuning provide the foundation that this chapter builds upon. The multi-row operations coverage is limited (pre-V11 features), but the cursor architecture and SQLCODE handling chapters are timeless.

  • Lawson, Susan, and Dan Luksetich. DB2 for z/OS Version 8 DBA Certification Guide (2004). The multi-row FETCH chapter in this certification guide provides excellent diagrams of the thread-switch reduction mechanism. Though written for V8, the fundamentals haven't changed.

SQL Technique

  • Celko, Joe. SQL for Smarties: Advanced SQL Programming, 5th Edition (2014). Celko's treatment of OLAP functions, CTEs (recursive and non-recursive), and temporal logic is platform-agnostic but deeply rigorous. His chapter on hierarchical queries complements the DB2-specific material in this chapter.

  • Molinaro, Anthony, and Robert de Graaf. SQL Cookbook, 2nd Edition (2020). Practical recipes for window functions, running totals, gap analysis, and hierarchical queries. The examples are in standard SQL and translate directly to DB2 with minor syntax adjustments.

Mainframe Performance

  • Beulke, Dave. Various articles and presentations on DB2 for z/OS performance optimization, available through the International DB2 Users Group (IDUG). Beulke's work on multi-row operations performance includes detailed CPU and elapsed-time benchmarks across DB2 versions that validate the performance claims in this chapter.

Technical Articles and Papers

Multi-Row Operations

  • "Multi-Row FETCH and INSERT in DB2 for z/OS" — IBM developerWorks (archived). This technical article walks through the complete conversion process from single-row to multi-row operations with COBOL examples, including the indicator array patterns and SQLERRD handling that production programs require.

  • "Optimizing Batch Processing with Multi-Row Operations" — IDUG Solutions Journal. A practitioners' perspective on the real-world conversion effort, including the bugs encountered, the testing strategy, and the performance results. Closely parallels the CNB case study in this chapter.

Temporal Tables

  • Saracco, Cynthia, Matthias Nicola, and Lennart Larsson. "Temporal Data Management in DB2" — IBM Research report. Provides the theoretical foundation for temporal data management in relational databases, including the formal semantics of system-time, application-time, and bi-temporal queries.

  • "HIPAA and CMS Compliance with DB2 Temporal Tables" — Healthcare-focused article on using temporal tables to meet regulatory requirements for point-in-time data reconstruction. Directly relevant to the Pinnacle Health case study.

OLAP Functions

  • "Window Functions in DB2 for z/OS: A Performance Study" — IDUG North America conference proceedings. Includes benchmark data comparing OLAP-function-based implementations against cursor-loop implementations for running totals, ranking, and moving averages. The results align with the 70% elapsed-time reduction cited in this chapter.

IDUG and Share Presentations

  • IDUG Annual Conference: Search the IDUG content library for presentations tagged "multi-row operations," "temporal tables," "recursive CTE," and "OLAP functions." These conference presentations often include real-world migration stories, performance data, and lessons learned that don't appear in IBM's official documentation.

  • SHARE Conference: The mainframe user group conference regularly features sessions on DB2 SQL techniques. The "DB2 for z/OS Advanced SQL" track consistently covers the topics in this chapter with production-tested examples.

Online Resources

  • IBM DB2 for z/OS Knowledge Center: The online documentation is searchable and includes the most current syntax for DB2 13. Bookmark the SQL Reference and the Application Programming Guide sections.

  • Planet Mainframe (planetmainframe.com): Regular articles on COBOL-DB2 programming techniques, including multi-row operations and temporal table implementations. The practitioner community contributing to this site provides perspectives that complement IBM's official documentation.

  • DB2 for z/OS Community on Stack Overflow: While smaller than the distributed DB2 community, the z/OS-specific questions and answers provide real-world troubleshooting guidance for the SQL constructs covered in this chapter.

Spaced Review Connections

  • Chapter 1 (z/OS DB2 Subsystem Architecture): Review the address space architecture to reinforce why thread switching is expensive and why multi-row operations provide such dramatic improvement.
  • Chapter 6 (DB2 Optimizer): Review access path selection to understand how MERGE, recursive CTEs, and OLAP functions appear in EXPLAIN output and how to interpret the access paths they generate.