Db2 for z/OS is a relational database manager that presents tables and indexes through SQL. Under the covers, much of the user data lives on data sets whose catalog entries look like VSAM linear data sets. That fact surprises newcomers who completed a VSAM unit on KSDS and ESDS and assumed Db2 was a completely separate planet. In reality, Db2 is a sophisticated consumer of DFSMS-managed storage: it maps internal pages to VSAM linear address space, manages those pages in Db2 buffer pools, and coordinates logging and recovery so that multiple SQL statements appear atomic. This page explains what you actually see on disk, how that differs from application-owned KSDS files, where classic VSAM tuning ideas still matter, and where Db2 concepts take over. It is written for beginners who know VSAM vocabulary but are meeting Db2 storage for the first time.
When you INSERT a row, Db2 evaluates constraints, finds space in a page, logs the change, and may schedule asynchronous write I/O to externalize the page to the underlying data set. Your program never passes a VSAM RPL to Db2 in normal application code. The VSAM layer is therefore an implementation detail—except when you wear the hat of a systems programmer, storage administrator, or recovery specialist who must restore, copy, or rebalance the physical data sets. At that moment, the VSAM catalog names, volume lists, and SMS classes matter just as much as they do for any other strategic object.
A Db2 table space dataset often appears as VSAM LINEAR or with attributes consistent with linear data set usage depending on version and definition. Names frequently include the database and table space tokens your Db2 administrator configured. Do not infer business meaning purely from the low-level qualifier; use the Db2 catalog (SYSIBM.SYSTABLESPACE and related tables) to map human-friendly table names to physical datasets. Beginners who jump straight to LISTCAT without the Db2 catalog map risk editing or moving the wrong object.
Db2 buffer pools hold copies of pages read from the underlying data sets. When a page is not in the pool, Db2 performs read I/O through DFSMS interfaces and the VSAM object materializes bytes on disk into memory. When many pages fit in memory, physical I/O drops: that is good. When the pool is too small for the working set, page stealing increases and VSAM-backed reads rise again. This feels like VSAM tuning in SMF traces but the corrective action is usually Db2 pool sizing, object redesign, or SQL reduction of random probes—not raising BUFND on an application DD, because the application is not issuing VSAM macros directly for those pages.
| Db2 role | VSAM-related note |
|---|---|
| Db2 catalog and directory | Hold metadata Db2 needs to boot and to locate user objects. Criticality is extreme; beginners should treat them like national treasure and never experiment casually. |
| User table space data sets | Store table rows in Db2 page format. You tune with Db2 page size, buffer pools, and SQL design more than with classic VSAM FREESPACE for these objects. |
| Index data sets | Store index tree pages. Random index probes show up as I/O to these objects when pages miss the Db2 buffer pool. |
Do not IDCAMS DELETE a Db2 table space data set because you "want to clear the table" while Db2 is running. Do not REPRO into it from a flat file as a shortcut to load data unless you are executing a documented Db2 utility pattern that owns recovery semantics. Do not alter share options or paths in the catalog without Db2-aware change control. Db2 protects data integrity with locks and logs; bypassing Db2 bypasses those protections.
The following Db2 catalog query is illustrative; column names and catalog version details differ across Db2 releases. Use your site's Db2 Administration Guide for exact syntax.
1234-- Ask your DBA for the supported catalog query on your Db2 level. -- Typical goal: map (DBNAME, table space name) -> dataset name(s). -- Starting points in documentation: SYSTABLESPACE, SYSTABLEPART, -- and volume or dataset linkage tables that change by Db2 version.
The pedagogical point is to show that Db2 exposes catalog tables so you never guess physical dataset names from SQL names alone. Copy the vendor-provided samples rather than improvising joins during production incidents.
Db2 B-tree index structures live on their own data sets. Random keyed lookups may touch several index pages before reaching the data page. That pattern resembles VSAM KSDS index walks conceptually, but Db2 controls page format and locking. When you see high index read I/O in monitors, the playbook is index design (columns, clustering, PADDED VARCHAR choices), buffer pool assignment for indexes, and sometimes partition strategy—not merely raising some generic VSAM BUFNI on a DD your application does not hold open for SQL.
Db2 is a librarian who lets you ask for books by title. The books still sit on metal shelves in the basement in straight lines—that is the VSAM linear shelf. You do not run downstairs and rearrange pages yourself; the librarian does it with rules. If you sneak downstairs and shove pages without telling the librarian, the catalog upstairs lies and everyone reads the wrong story next Tuesday.
1. Applications should access Db2 user table data primarily through:
2. Db2 buffer pools mainly cache:
3. LISTCAT shows a linear VSAM data set backing a table space. Who defines FREESPACE for that object in daily work?