Virtual Storage Access Method: Difference between revisions
imported>Guy Harris →External links: Fix template invocation. |
|||
| Line 1: | Line 1: | ||
{{Short description|IBM disk file programming interface}} | {{Short description|IBM disk file programming interface}} | ||
'''Virtual Storage Access Method''' ('''VSAM''')<ref>{{cite magazine |magazine=[[Datamation]] | '''Virtual Storage Access Method''' ('''VSAM''')<ref>{{cite magazine |magazine=[[Datamation]] | ||
|url=https://www.datamation.com/netsys/article.php/3677001/New-Life-for-Legacy-Systems-at-LaBarge.htm | |url=https://www.datamation.com/netsys/article.php/3677001/New-Life-for-Legacy-Systems-at-LaBarge.htm | ||
|title=New Life for Legacy Systems at LaBarge | |title=New Life for Legacy Systems at LaBarge | ||
|date=May 11, 2007}}</ref> is an [[IBM]] [[ | |date=May 11, 2007}}</ref> is an [[IBM]] [[direct-access storage device]] (DASD) file storage [[access method]], first used in the [[OS/VS1]], OS/VS2 [[OS/VS2 (SVS)|Release 1]] (SVS) and [[MVS|Release 2]] (MVS) operating systems, later used throughout the [[MVS|Multiple Virtual Storage]] (MVS) architecture and now in [[z/OS]]. Originally a [[record-oriented filesystem]],{{#tag:ref|With the exception of catalogs, page spaces and swap<ref group=NB>No longer used.</ref> spaces, which unauthorized applications could access only via specialized OS services. Not to mention the fact that it's been in VSE for ever too and is used in z/VSE|group="NB"|name=notfile}} VSAM comprises four<ref group=NB name=notfile/> [[data set (IBM mainframe)|data set]] ''organizations'': [[key-sequenced data set|key-sequenced]] (KSDS), [[relative record data set|relative record]] (RRDS), [[entry-sequenced data set|entry-sequenced]] (ESDS) and [[linear data set|linear]] (LDS).{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.3.2 Record management|page=5}} The KSDS, RRDS and ESDS organizations contain records, while the LDS organization (added later to VSAM) contains a sequence of pages with no intrinsic record structure, for use as a [[memory-mapped file]]. | ||
==Overview== | ==Overview== | ||
| Line 11: | Line 10: | ||
|title=VSAM Primer}}</ref> IBM uses the term ''data set'' in official documentation as a synonym for ''file'', and ''[[direct-access storage device]]'' (''DASD'') for devices with [[random access]] to data locations, such as disk drives, as opposed to devices such as tape drives that can only be read sequentially. | |title=VSAM Primer}}</ref> IBM uses the term ''data set'' in official documentation as a synonym for ''file'', and ''[[direct-access storage device]]'' (''DASD'') for devices with [[random access]] to data locations, such as disk drives, as opposed to devices such as tape drives that can only be read sequentially. | ||
VSAM records can be of fixed or variable length. They are organised in fixed-size blocks called [[control interval]]s (CIs),<ref name="VSAM.CI1">{{cite web |title=VSAM – Components |url=https://www.tutorialZpoint.com/vsam/vsam_components.htm}}</ref><ref name=VSAM.CI2>{{cite web | VSAM records can be of fixed or variable length. They are organised in fixed-size blocks called [[control interval]]s (CIs),<ref name="VSAM.CI1">{{cite web |title=VSAM – Components |url=https://www.tutorialZpoint.com/vsam/vsam_components.htm }}{{Dead link|date=October 2025 |bot=InternetArchiveBot }}</ref><ref name=VSAM.CI2>{{cite web | ||
|url=https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.idad400/d4221.htm | |url=https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.idad400/d4221.htm | ||
|title=Control Interval Size Limitations|website=[[IBM]] |date=27 March 2014 }}</ref> and then into larger divisions called Control Areas (CAs). Control Interval sizes are measured in bytes{{snd}} for example 4 [[kilobyte]]s{{snd}} 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. | |title=Control Interval Size Limitations|website=[[IBM]] |date=27 March 2014 }}</ref> and then into larger divisions called Control Areas (CAs). Control Interval sizes are measured in bytes{{snd}} for example 4 [[kilobyte]]s{{snd}} 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. | ||
| Line 17: | Line 16: | ||
The Access Method Services utility program [[IBM mainframe utility programs#IDCAMS|IDCAMS]] is commonly used to manipulate ("delete and define") VSAM data sets. Custom programs can access VSAM datasets through Data Definition (DD) statements in [[Job Control Language]] (JCL), via dynamic allocation or in online regions such as in [[CICS|Customer Information Control System]] (CICS). | The Access Method Services utility program [[IBM mainframe utility programs#IDCAMS|IDCAMS]] is commonly used to manipulate ("delete and define") VSAM data sets. Custom programs can access VSAM datasets through Data Definition (DD) statements in [[Job Control Language]] (JCL), via dynamic allocation or in online regions such as in [[CICS|Customer Information Control System]] (CICS). | ||
Both [[IMS/DB]]{{fact|date=April 2021}} and [[IBM Db2|Db2]] | Both [[IMS/DB]]{{fact|date=April 2021}} and [[IBM Db2|Db2]]{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.8.1 DB2 |page=41}}<ref>{{cite web | ||
|url=https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/izodav110sc279034/%24file/azk1b100.pdf | |url=https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/izodav110sc279034/%24file/azk1b100.pdf | ||
|title=User's Guide|date=16 February 2024 }}</ref> are implemented on top of VSAM and use its underlying [[data structure]]s. | |title=User's Guide|date=16 February 2024 }}</ref> are implemented on top of VSAM and use its underlying [[data structure]]s. | ||
==Files== | ==Files== | ||
The physical organization of VSAM data sets differs considerably from the organizations | The physical organization of VSAM data sets differs considerably from the organizations supported by other access methods, as follows. | ||
A VSAM file is defined as a cluster of VSAM components, e.g., for KSDS a DATA component and an INDEX component. | A VSAM file is defined as a cluster of VSAM components, e.g., for KSDS a DATA component and an INDEX component. | ||
| Line 36: | Line 35: | ||
===Sequential organization=== | ===Sequential organization=== | ||
{{ | An '''entry-sequenced data set''' ('''ESDS''') is a type of [[data set (IBM mainframe)|data set]] organization supported by VSAM.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.3.2 Record management|page=5}} Records are accessed based on their sequential order, that is, the order in which they were written to the file;<ref>{{cite web|url=https://walton.uark.edu/enterprise/IBM/systemZ/downloads/module3/VSAM-Introductory.ppt|title=VSAM: introductory}}</ref><ref>{{cite web |title=Server Functionality |url=https://supportline.microfocus.com/documentation/books/tps62/mafunc.htm |quote=Sequential (VSAM ESDS – Entry Sequenced Dataset) }}{{Dead link|date=October 2025 |bot=InternetArchiveBot }}</ref><ref>{{cite web|url=http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.469.8853&rep=rep1&type=pdf|quote=An ESDS VSAM data set contains records in the order in which they were entered|title=ABCs of z/OS System Programming Volume 3|citeseerx=10.1.1.469.8853}}</ref> which means that accessing a particular record involves searching all the records [[Sequential access|sequentially]] until it is located, or by using a ''Relative byte address''<ref group=NB name=RBA>Since control areas may be scattered, this is not a relative physical address.</ref> (RBA), i.e., the number of bytes from the beginning of the file to start reading.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.5.2 Entry-sequenced data set|page=28}} | ||
Records are loaded irrespective of their contents and their byte addresses cannot be changed. | |||
While an ESDS has no key, alternate indexes (AIXs) may be defined to permit the use of fields as keys.<ref>{{cite book | |||
| title = ABCs of OS/390 System Programming - Volume 3 | |||
| id = SG24-5653-00 | |||
| first1 = P. | |||
}}</ref> | | last1 = Rogers | ||
| first2 = G. | |||
| last2 = Capobianco | |||
| first3 = D. | |||
| last3 = Carey | |||
| first4 = N. | |||
| last4 = Davies | |||
| first5 = L. | |||
| last5 = Fadel | |||
| first6 = K. | |||
| last6 = Hewitt | |||
| first7 = J. | |||
| last7 = Oliveira | |||
| first8 = F. | |||
| last8 = Pita | |||
| first9 = A. | |||
| last9 = Salla | |||
| first10 = V. | |||
| last10 = Sokal | |||
| first11 = Y. F. | |||
| last11 = Tay | |||
| first12 = H. | |||
| last12 = Timm | |||
| date = April 2000 | |||
| page = 108 | |||
| section = 1.19.11 Entry sequenced data set (ESDS) | |||
| section-url = https://www.redbooks.ibm.com/redbooks//pdfs/sg245653.pdf#page=128 | |||
| quote = Although an entry-sequenced data set does not contain an index component, alternate indexes are allowed. You can build an alternate index to keep track of these RBAs. | |||
| isbn = 9780738416182 | |||
| publisher = International Technical Support Organization [[IBM]] | |||
| series = Redbooks | |||
| url = https://www.redbooks.ibm.com/redbooks//pdfs/sg245653.pdf | |||
| access-date = July 6, 2025 | |||
}} | |||
</ref> An alternate index is itself a KSDS. | |||
<!-- Replace with most recent? LCCN? OCLC? --> | |||
===Indexed organization=== | ===Indexed organization=== | ||
{{ | A '''key-sequenced data set''' (KSDS) is a type of [[data set (IBM mainframe)|data set]] supported by VSAM. Each record in a KSDS data file is embedded with a unique key.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.5.1 Key-sequenced data set (KSDS)|page=20}} A KSDS consists of two parts, the data component and a separate [[index file]] known as the index component which allows the system to physically locate the record in the data file by its key value.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.4.6 Components|page=13}} Together, the data and index components are called a cluster.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.4.7 Clusters|page=15}} | ||
A KSDS | |||
Records can be accessed randomly or in sequence and can be variable-length. | |||
The data structure used by a KSDS is nowadays known as a [[B+ tree]].<ref>{{cite web | As a [[VSAM]] data set, the KSDS data and index components consist of control intervals{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.4.3 Control interval|page=10}} which are further organized in control areas.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.4.5 Control area|page=12}} As records are added at random to a KSDS, control intervals fill and need to be split into two new control intervals, each new control interval receiving roughly half of the records. Similarly, as the control intervals in a control area are used up, a control area will be split into two new control areas, each new control area receiving roughly half the control intervals.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.4.10 Splits|page=17}} | ||
While a basic KSDS only has one key (the primary key), alternate indices may be defined to permit the use of additional fields as secondary keys.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.4.8 Alternate indexes|pages=15-16}} An alternate index is itself a KSDS.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.4.8 Alternate indexes|page=16}} | |||
|url=https://www.wisegeek.com/what-is-vsam.htm | |||
|quote=This index is called a B+ tree. | The data structure used by a KSDS is nowadays known as a [[B+ tree]].<ref>{{cite web|url=https://patents.justia.com/patent/9043295|title=US Patent for Providing record-level alternate-index upgrade locking}}</ref><ref>{{cite web|url=https://www.wisegeek.com/what-is-vsam.htm|quote=This index is called a B+ tree.|title=What is VSAM?}}</ref> | ||
|title=What is VSAM?}}</ref> | |||
===Relative organization=== | ===Relative organization=== | ||
{{ | A '''relative record data set''' (RRDS) is a type of [[data set (IBM mainframe)|data set]] organization supported by VSAM.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.3.2 Record management|page=5}} Records are accessed based on their ordinal position in the file (''relative record number'', RRN).{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.5.3 Relative record data set|pages=29-30}} For example, the desired record to be accessed might be the 42nd record in the file out of 999 total. The concept of RRDS is similar to [[sequential access]] method, but it can access with data in [[random access]] and dynamic access.{{huh|date=April 2021}} | ||
An RRDS | An RRDS consists of data records in sequence, with the record number indicating the record's logical position in the data set.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.5.3 Relative record data set |page=30}} A program can access records randomly using this positional number or access records sequentially.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=Relative record data set |page=30}} But unlike a [[Key Sequenced Data Set]], an RRDS has no keys, so the program cannot access records by key value. | ||
=== Linear organization === | === Linear organization === | ||
{{ | A '''linear data set''' (LDS) is a type of [[data set (IBM mainframe)|data set]] organization supported by VSAM.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.3.2 Record management|page=5}} The LDS has a control interval size of 4096 bytes to 32768 bytes<ref>{{cite manual|title = z/OS 2.5 DFSMS Using Data Sets|id = SC23-6855-50| section = Linear Data sets| section-url = https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R5sc236855/$file/idad400_v2r5.pdf#page=126|page = 91|date = September 30, 2021|url = https://www-01.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R5sc236855/$file/idad400_v2r5.pdf|publisher = IBM}}</ref> in increments of 4096.{{sfn|Lovelace|Dovidauskas|Salla|Sokal|2022|at=1.5.5 Linear data set |page=31}} A LDS does not have embedded control information, because it does not contain control information, the LDS cannot be accessed as if it contained individual records.<ref>{{Cite web|title=IBM Knowledge Center|url=https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.idad400/d4261.htm|access-date=2021-02-07|website=www.ibm.com| date=27 March 2014 |language=en-US}}</ref> | ||
Addressing within an LDS is by Relative Byte Address (RBA), which allows it to be used by systems such as [[IBM Db2]] or the Operating system.{{huh|date=April 2021}} The benefit of this is that systems such as the OS can access multiple disk spindles and view it as a single storage implementation. The limitations of this, though, is that this does not make this particularly useful to higher level abstraction levels.{{or|date=April 2021}} Data In Virtual{{sfn|ASMGUIDE|loc=Chapter 14. Data-in-virtual|pp=[https://www.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R5sa231368/$file/ieaa600_v2r5.pdf#page=253 225-248]}} (DIV) and Window services{{sfn|ASMGUIDE|loc=Chapter 17. Window Services|pp=[https://www.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R5sa231368/$file/ieaa600_v2r5.pdf#page=321 293-310]}} provide an alternative method to direct use of VSAM to access an LDS with a CI size of 4096. | |||
== Data access techniques == | == Data access techniques == | ||
| Line 87: | Line 120: | ||
==History== | ==History== | ||
VSAM was introduced as a replacement for older access methods<ref>{{cite manual | VSAM was introduced as a replacement for older access methods<ref>{{cite manual|title = OS/Virtual Storage 1 Features Supplement |id = GC20-1752-0| date = August 1972|edition = First|url = http://bitsavers.org/pdf/ibm/370/OS_VS1/GC20-1752-0_OS_VS1_Features_Supplement_Aug72.pdf| publisher = IBM}} | ||
</ref> and was intended to add function, to be easier to use and to overcome problems of performance and device-dependence. VSAM was introduced in the 1970s when IBM announced [[virtual memory|virtual storage]] operating systems (DOS/VS, OS/VS1 and OS/VS2) for its new System/370 series, as successors of the [[DOS/360 and successors|DOS/360]] and [[OS/360 and successors|OS/360]] operating systems running on its System/360 computer series. While backwards compatibility was maintained, the older access methods suffered from performance problems due to the address translation required for virtual storage. | </ref> and was intended to add function, to be easier to use and to overcome problems of performance and device-dependence. VSAM was introduced in the 1970s when IBM announced [[virtual memory|virtual storage]] operating systems (DOS/VS, OS/VS1 and OS/VS2) for its new System/370 series, as successors of the [[DOS/360 and successors|DOS/360]] and [[OS/360 and successors|OS/360]] operating systems running on its System/360 computer series. While backwards compatibility was maintained, the older access methods suffered from performance problems due to the address translation required for virtual storage. | ||
| Line 117: | Line 143: | ||
== References == | == References == | ||
{{reflist}} | {{reflist}} | ||
===Bibliography=== | |||
* {{cite book | |||
| url = https://www.redbooks.ibm.com/redbooks/pdfs/sg246105.pdf | |||
| series = Redbooks | |||
| title = VSAM Demystified | |||
| first1 = Mary | |||
| last1 = Lovelace | |||
| first2 = Jose | |||
| last2 = Dovidauskas | |||
| first3 = Alvaro | |||
| last3 = Salla | |||
| first4 = Valeria | |||
| last4 = Sokal | |||
| edition = 3 | |||
| publisher = [[IBM]] | |||
| date = August 2022 | |||
}} | |||
* [http://www.redbooks.ibm.com/abstracts/sg246105.html?Open VSAM Demystified] | * [http://www.redbooks.ibm.com/abstracts/sg246105.html?Open VSAM Demystified] | ||
* [https://www-304.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3SC236877/$file/idat100_v2r3.pdf DFSMStvs Overview and Planning Guide] | * [https://www-304.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R3SC236877/$file/idat100_v2r3.pdf DFSMStvs Overview and Planning Guide] | ||
==Further reading== | |||
*{{cite manual|title = z/OS 2.5 MVS Programming: Assembler Services Guide|id = SA23-1368-50|date = September 30, 2021|url = https://www.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R5sa231368/$file/ieaa600_v2r5.pdf|ref = {{sfnref|ASMGUIDE}}| publisher = IBM}} | |||
*{{cite web|url=http://www.mvsforums.com/techfaqsvsam.html|title=MVS Forums - Technical FAQ's - VSAM|website=Mvsforums.com|accessdate=12 December 2017}} | |||
==External links== | |||
*{{webarchive |url=https://web.archive.org/web/20051023212932/http://www.lascon.co.uk/d002303.htm Lascon.co.uk |date=2005-10-23 |title=VSAM Tuning Parameters}} | |||
*{{webarchive |url=https://web.archive.org/web/20051013071230/http://www.jaymoseley.com/hercules/vstutor/vstutor.htm |date=2005-10-13 |title=VSAM Tutorial}} | |||
*[http://www.mvsforums.com/techfaqsvsam.html VSAM Technical FAQ's] | |||
{{Mainframe I/O access methods}} | {{Mainframe I/O access methods}} | ||
Latest revision as of 21:08, 19 December 2025
Template:Short description Virtual Storage Access Method (VSAM)[1] is an IBM direct-access storage device (DASD) file storage access method, first used in the OS/VS1, OS/VS2 Release 1 (SVS) and Release 2 (MVS) operating systems, later used throughout the Multiple Virtual Storage (MVS) architecture and now in z/OS. Originally a record-oriented filesystem,[NB 2] VSAM comprises four[NB 2] data set organizations: key-sequenced (KSDS), relative record (RRDS), entry-sequenced (ESDS) and linear (LDS).Template:Sfn The KSDS, RRDS and ESDS organizations contain records, while the LDS organization (added later to VSAM) contains a sequence of pages with no intrinsic record structure, for use as a memory-mapped file.
Overview
An IBM Redbook named "VSAM PRIMER" (especially when used with the "Virtual Storage Access Method (VSAM) Options for Advanced Applications" manual) explains the concepts needed to make use of VSAM.[2] IBM uses the term data set in official documentation as a synonym for file, and direct-access storage device (DASD) for devices with random access to data locations, such as disk drives, as opposed to devices such as tape drives that can only be read sequentially.
VSAM records can be of fixed or variable length. They are organised in fixed-size blocks called control intervals (CIs),[3][4] and then into larger divisions called Control Areas (CAs). Control Interval sizes are measured in bytesTemplate:Snd for example 4 kilobytesTemplate:Snd 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 Definition (DD) statements in Job Control Language (JCL), via dynamic allocation or in online regions such as in Customer Information Control System (CICS).
Both IMS/DBTemplate:Fact and Db2Template:Sfn[5] are implemented on top of VSAM and use its underlying data structures.
Files
The physical organization of VSAM data sets differs considerably from the organizations supported by other access methods, as follows.
A VSAM file is defined as a cluster of VSAM components, e.g., for KSDS a DATA component and an INDEX component.
Control intervals and control areas
VSAM components consist of fixed length physical blocks grouped into fixed length control intervals[3][4] (CI) and control areas (CA). The size of the CI and CA is determined by the Access Method Services (AMS), and the way in which they are used is normally not visible to the user. There will be a fixed number of control intervals in each control area.
A control interval normally contains multiple records. The records are stored within the control interval starting from the low address upwards. Control information is stored at the other end of the control interval, starting from the high address and moving downwards. The space between the records and the control information is free space. The control information comprises two types of entry: a control interval descriptor field (CIDF) which is always present, and record descriptor fields (RDF) which are present when there are records within the control interval and describe the length of the associated record. Free space within a CI is always contiguous.
When records are inserted into a control interval, they are placed in the correct order relative to other records. This may require records to be moved out of the way inside the control interval. Conversely, when a record is deleted, later records are moved down so that the free space remains contiguous. If there is not enough free space in a control interval for a record to be inserted, the control interval is split. Roughly half the records are stored in the original control interval while the remaining records are moved into a new control interval. The new control interval is taken from a pool of free control intervals within the same control area as the original control interval. If there is no remaining free control interval within that control area, the control area itself is split and the control intervals are distributed equally between the old and the new control areas.
You can use three types of record-orientated file organization with VSAM (the contents of linear data sets have no record structure):
Sequential organization
An entry-sequenced data set (ESDS) is a type of data set organization supported by VSAM.Template:Sfn Records are accessed based on their sequential order, that is, the order in which they were written to the file;[6][7][8] which means that accessing a particular record involves searching all the records sequentially until it is located, or by using a Relative byte address[NB 3] (RBA), i.e., the number of bytes from the beginning of the file to start reading.Template:Sfn
Records are loaded irrespective of their contents and their byte addresses cannot be changed.
While an ESDS has no key, alternate indexes (AIXs) may be defined to permit the use of fields as keys.[9] An alternate index is itself a KSDS.
Indexed organization
A key-sequenced data set (KSDS) is a type of data set supported by VSAM. Each record in a KSDS data file is embedded with a unique key.Template:Sfn A KSDS consists of two parts, the data component and a separate index file known as the index component which allows the system to physically locate the record in the data file by its key value.Template:Sfn Together, the data and index components are called a cluster.Template:Sfn
Records can be accessed randomly or in sequence and can be variable-length.
As a VSAM data set, the KSDS data and index components consist of control intervalsTemplate:Sfn which are further organized in control areas.Template:Sfn As records are added at random to a KSDS, control intervals fill and need to be split into two new control intervals, each new control interval receiving roughly half of the records. Similarly, as the control intervals in a control area are used up, a control area will be split into two new control areas, each new control area receiving roughly half the control intervals.Template:Sfn
While a basic KSDS only has one key (the primary key), alternate indices may be defined to permit the use of additional fields as secondary keys.Template:Sfn An alternate index is itself a KSDS.Template:Sfn
The data structure used by a KSDS is nowadays known as a B+ tree.[10][11]
Relative organization
A relative record data set (RRDS) is a type of data set organization supported by VSAM.Template:Sfn Records are accessed based on their ordinal position in the file (relative record number, RRN).Template:Sfn For example, the desired record to be accessed might be the 42nd record in the file out of 999 total. The concept of RRDS is similar to sequential access method, but it can access with data in random access and dynamic access.Script error: No such module "Unsubst".
An RRDS consists of data records in sequence, with the record number indicating the record's logical position in the data set.Template:Sfn A program can access records randomly using this positional number or access records sequentially.Template:Sfn But unlike a Key Sequenced Data Set, an RRDS has no keys, so the program cannot access records by key value.
Linear organization
A linear data set (LDS) is a type of data set organization supported by VSAM.Template:Sfn The LDS has a control interval size of 4096 bytes to 32768 bytes[12] in increments of 4096.Template:Sfn A LDS does not have embedded control information, because it does not contain control information, the LDS cannot be accessed as if it contained individual records.[13]
Addressing within an LDS is by Relative Byte Address (RBA), which allows it to be used by systems such as IBM Db2 or the Operating system.Script error: No such module "Unsubst". The benefit of this is that systems such as the OS can access multiple disk spindles and view it as a single storage implementation. The limitations of this, though, is that this does not make this particularly useful to higher level abstraction levels.Template:Or Data In VirtualTemplate:Sfn (DIV) and Window servicesTemplate:Sfn provide an alternative method to direct use of VSAM to access an LDS with a CI size of 4096.
Data access techniques
There are four types of access techniques for VSAM data:
- Local Shared Resources (LSR), is optimised for "random" or direct access. LSR access is easy to achieve from CICS.[14]
- Global Shared Resources (GSR)[15]
- Non-Shared Resources (NSR), which is optimised for sequential access. NSR access has historically been easier to use than LSR for batch programs.[14]
- Distributed File Management (DFM), an implementation of a Distributed Data Management Architecture server, enables programs on remote computers to create, manage, and access VSAM files.
Sharing data
Sharing of VSAM data between CICS regions can be done by VSAM Record-Level Sharing (RLS). This adds record caching and, more importantly, record locking. Logging and commit processing remain the responsibility of CICS which means that sharing of VSAM data outside a CICS environment is severely restricted.
Sharing between CICS regions and batch jobs requires Transactional VSAM, DFSMStvs. This is an optional program that builds on VSAM RLS by adding logging and two-phase commit, using underlying z/OS system services. This permits generalised sharing of VSAM data.
History
VSAM was introduced as a replacement for older access methods[16] and was intended to add function, to be easier to use and to overcome problems of performance and device-dependence. VSAM was introduced in the 1970s when IBM announced virtual storage operating systems (DOS/VS, OS/VS1 and OS/VS2) for its new System/370 series, as successors of the DOS/360 and OS/360 operating systems running on its System/360 computer series. While backwards compatibility was maintained, the older access methods suffered from performance problems due to the address translation required for virtual storage.
The KSDS organization was designed to replace ISAM, the Indexed Sequential Access Method. Changes in disk technology had meant that searching for data in ISAM data sets had become very inefficient. It was also difficult to move ISAM data sets as there were embedded pointers to physical disk locations which became invalid if the data set was moved. IBM also provided a compatibility interface to allow programs coded to use ISAM to use a KSDS instead.
The RRDS organization was designed to replace BDAM, the Basic Direct Access Method. In some cases, BDAM data sets contained embedded pointers which prevented them from being moved. However, most BDAM data sets did not and the incentive to move from BDAM to VSAM RRDS was much less compelling than that to move from ISAM to VSAM KSDS.
Linear data sets were added later, followed by VSAM RLS and then Transactional VSAM.
See also
- Job Control Language (JCL)
- IBM mainframe utility programs
- ISAM
- Geneva ERS
- Record Management Services, a similar system developed by Digital Equipment Corporation
- Enscribe, a similar system developed by Tandem Computers
- Berkeley DB
Notes
<templatestyles src="Reflist/styles.css" />
- ↑ No longer used.
- ↑ a b With the exception of catalogs, page spaces and swap[NB 1] spaces, which unauthorized applications could access only via specialized OS services. Not to mention the fact that it's been in VSE for ever too and is used in z/VSE
- ↑ Since control areas may be scattered, this is not a relative physical address.
Script error: No such module "Check for unknown parameters".
References
<templatestyles src="Reflist/styles.css" />
- ↑ Script error: No such module "Citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ a b Script error: No such module "citation/CS1".Script error: No such module "Unsubst".
- ↑ a b Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".Script error: No such module "Unsubst".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ a b Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
Script error: No such module "Check for unknown parameters".
Bibliography
- Script error: No such module "citation/CS1".
- VSAM Demystified
- DFSMStvs Overview and Planning Guide
Further reading
- Script error: No such module "citation/CS1".
- Script error: No such module "citation/CS1".
External links
Script error: No such module "Navbox".