Thursday, May 8, 2008

VSAM


Recently, a customer asked me about how to set up database connection with a non-RDBMS data warehouse under VSAM data structure. This is the first time that I heard VSAM; what is VSAM? As a curious freak, I found some interested information from my dear Wikipedia:

“Virtual storage access method (VSAM) is an IBM disk file storage access method, first used in the OS/VS2 operating system, later used throughout the Multiple Virtual Storage (MVS) architecture and now in z/OS. Originally a record-oriented filesystem, VSAM comprises four data set organizations: Key Sequenced Data Set (KSDS), Relative Record Data Set (RRDS), Entry Sequenced Data Set (ESDS) and Linear Data Set (LDS). The KSDS, RRDS and ESDS organizations contain records, while the LDS organization (added later to VSAM) simply contains a sequence of bytes with no intrinsic record structure.
IBM uses the term data set in official documentation as a synonym of file, and DASD instead of disk drive.

VSAM records can be of fixed or variable length. They are organized in fixed-size blocks called Control Intervals (CIs), and then into larger divisions called Control Areas (CAs). Control Interval sizes are measured in bytes — for example 4 kilobytes — while Control Area sizes are measured in disk tracks or cylinders. Control Intervals are the units of transfer between disk and computer so a read request will read one complete Control Interval. Control Areas are the units of allocation so, when a VSAM data set is defined, an integral number of Control Areas will be allocated.
The Access Method Services utility program IDCAMS is commonly used to manipulate ("delete and define") VSAM data sets. Custom programs can access VSAM datasets through data definitions (DDs) in Job Control Language (JCL) or in online regions such as in Customer Information Control Systems (CICS).

Both IMS/DB and DB2 are implemented on top of VSAM and use its underlying data structures.

There are three types of access technique for VSAM data:
• Local Shared Resources (LSR)
• Global Shared Resources (GSR)
• Non-Shared Resources (NSR)

Each is optimised for different access patterns. For example, LSR is optimised for "random" or direct access, whereas NSR is optimised for sequential access.

Another difference is that some access techniques are more available than others for specific execution and programming environments. For example, LSR access is easy to achieve from CICS while NSR access has historically been easier to use than LSR for batch programs.”

VSAM data structure works like FAT, but interesting enough “VSAM records can be of fixed or variable length.” Therefore, it definitely can be taken advantage of applying in large database structures. Maybe I need to play more in DB2 to check how the VSAM works and improves the performance.

No comments:

LinkWithin

Related Posts with Thumbnails