Presentation is loading. Please wait.

Presentation is loading. Please wait.

MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved.

Similar presentations


Presentation on theme: "MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved."— Presentation transcript:

1 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved.

2 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 2 UNIT  Foundation Concepts  VSAM Data Set Types  VSAM Terminology  Access Method Services Topics: VSAM Concepts and Terms

3 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 3 What is an access method? Most computer applications are designed to manipulate data and generate results based on the data. Data must be stored in a way that its retrieval is easy and quick. Access methods are ways to maximize the efficiency of data storage and retrieval. Access Methods An access method acts as an interface between a processing program and the operating system. Continued… Unit: VSAM Concepts and Terms Concepts Access Methods DASD Topic: Foundation Concepts

4 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 4 Virtual Storage Access Method Virtual Storage Access Method (VSAM) is the first access method specifically designed to operate in a virtual storage environment. VSAM is more compatible with operating systems MVS, MVS/XA and MVS/ESA than other access methods. The compatibility of VSAM with various operating systems provides greater efficiency for the application programs using VSAM and also for the overall environment. Continued… Unit: VSAM Concepts and Terms Concepts VSAM DASD Topic: Foundation Concepts

5 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 5 VSAM retrieves a record by following these steps: 1. VSAM interprets the processing program’s logical request and determines what services are desired. 2. VSAM makes the required Input or Output (I/O) request(s) to the operating system. 3. The operating system performs the physical I/O operation(s) between the device and the storage. 4. VSAM locates and extracts the desired data before returning it to the processing program. Virtual Storage Access Method (cont’d) Continued… Unit: VSAM Concepts and Terms Concepts Operating System DASD VSAM Processing Program Topic: Foundation Concepts

6 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 6 Two important variations in the process of retrieving a record are: A record requested by a processing program may already be in virtual storage. No physical I/O operations are needed in such a case. Sometimes due to the way VSAM stores data and variety of processing options it supports, it must issue several I/O requests to retrieve a single record. Virtual Storage Access Method (cont’d) Continued… Unit: VSAM Concepts and Terms Concepts Topic: Foundation Concepts

7 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 7 VSAM groups individual data records into larger units in order to reduce the number of I/O requests required when sequentially retrieving records. These larger units are transferred between the Direct Access Storage Device (DASD) and virtual storage by the operating system. Virtual Storage Access Method (cont’d) Continued… Unit: VSAM Concepts and Terms Concepts record DASD Topic: Foundation Concepts

8 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 8 What is the role of VSAM? VSAM acts as an interface between processing programs and the operating system. A processing program invokes VSAM routines as subroutines. In Assembler Language programs, subroutines are invoked by issuing VSAM macros. In High Level Languages, the language compilers convert I/O statements into calls to the appropriate VSAM routines. When the I/O request has been processed, control is returned to the processing program. Virtual Storage Access Method (cont’d) Unit: VSAM Concepts and Terms Concepts Topic: Foundation Concepts

9 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 9 VSAM supports the following data set types: Entry-Sequenced Data Set (ESDS) Key-Sequenced Data Set (KSDS) Relative Record Data Set (RRDS) Linear Data Set (LDS) Overview of Data Set Types Unit: VSAM Concepts and Terms Concepts Topic: VSAM Data Set Types

10 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 10 Records in an ESDS are stored in the order in which they are written and are retrieved by addressed access. Records are loaded irrespective of their contents and their byte addresses cannot be changed. ESDS is also referred to as a sequential VSAM data set. This is because records in an ESDS are normally processed sequentially. ESDS is best suited for applications where most processing is done sequentially. Entry-Sequenced Data Set Unit: VSAM Concepts and Terms Concepts Topic: VSAM Data Set Types

11 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 11 Records in a KSDS are stored in key sequence and are controlled by an index. The key field of records determine the order in which records are stored. In a KSDS, records can be processed both sequentially and randomly using their key field values. The advantages of KSDS are: Sequential processing is useful for retrieving records in the sorted form Random or direct processing of records is useful in on-line applications Key-Sequenced Data Set Unit: VSAM Concepts and Terms Concepts Topic: VSAM Data Set Types

12 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 12 Relative Record Data Set Records in an RRDS are loaded into fixed-length or variable length slots. These records are represented by the Relative Record Numbers (RRNs) of their slots. A processing program uses RRN to provide random access to records. The records in an RRDS can also be accessed sequentially in its RRN order. It is also possible to convert key values into RRNs. Accessing data using RRNs is preferred by many applications, such as inventory file management. Continued… Unit: VSAM Concepts and Terms Concepts R1R2R3 Slots 1 234 Relative Record Numbers Topic: VSAM Data Set Types

13 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 13 Linear Data Set LDS is a data set containing only a contiguous string of data bytes with no intervening control information. An LDS is divided into blocks. These blocks can be sequentially retrieved by a processing program in physical order. A processing program can group several logical records together into a single block LDS can be kept permanently in store for enhanced performance. The purpose of the LDS data set type is to provide a format that can be used more easily with the extended addressing feature found in Multiple Virtual Storage / Enterprise Systems Architecture (MVS/ESA). It is used for special applications requiring large amount of data to be maintained in virtual storage. Application programs prefer an ESDS to an LDS. ESDS provides same processing abilities and can block and unblock logical records automatically. Continued… Unit: VSAM Concepts and Terms Concepts Topic: VSAM Data Set Types

14 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 14 A cluster is the collection of physical data sets that make up one logical data set. The concept of a cluster is more suited for a KSDS. A KSDS cluster has two data sets. One data set holds the actual data records. The other data set contains an index component. The index component permits the direct retrieval of data. What is a Cluster? Continued… Unit: VSAM Concepts and Terms Concepts KSDS.CLUSTER KSDS.INDEX KSDS.DATA Topic: VSAM Terminology

15 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 15 What is a control interval? A control interval is the amount of data transferred between the device and virtual storage. When a record is read from or written to a data set, VSAM groups individual data records into larger units of storage. These units of storage are called control intervals. Control Interval Continued… Unit: VSAM Concepts and Terms Concepts Topic: VSAM Terminology

16 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 16 A control interval is the amount of data transferred between the device and virtual storage. VSAM groups individual data records into larger units of storage. These units of storage are called control intervals. All control intervals for a given data set are of the same size. However, the records within a control interval can vary in length. Control Interval (cont’d) Unit: VSAM Concepts and Terms Concepts R1 Unused Space 420420 340340 220220 9 1 80 0 5 5 A 2k (2048 bytes) Control Interval Topic: VSAM Terminology

17 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 17 The control intervals for a data set are grouped Into one or more control areas. The number of control intervals in a control area is fixed by VSAM. Control Area Unit: VSAM Concepts and Terms Concepts 05080910 12141520 21 29 22 30 2425 3536 Control Area with Control Intervals Topic: VSAM Terminology

18 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 18 What is Access Method Services? VSAM uses certain utility programs for managing and maintaining data sets. Access Method Services (AMS) is a utility that defines VSAM data sets and allocates space for them. It also converts indexed sequential data sets to KSDS with indexes. AMS can also be used to perform some functions for non-VSAM data sets. Access Method Services Continued… Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts

19 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 19 What is IntegrateD Catalog Access Method Services? IntegrateD Catalog Access Method Services (IDCAMS) is the program name for VSAM’s AMS utility. IDCAMS is easy to use and multipurpose in nature. IDCAMS performs the following functions: Access Method Services (cont’d) It defines a data set It loads a data set It copies or backs up a data set It prints the contents of a data set It changes certain attributes of a data set It lists data set attributes and statistical information It deletes a data set Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts

20 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 20 Some of the non-VSAM utility programs are: IEBGENER– Used to copy a SAM data set IEBCOPY– Used to copy a partitioned data set Non-VSAM Utility Programs Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts

21 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 21 What is defining a data set? The process of creating catalog entries for a VSAM data set and allocating space for them is called defining the data set. A data set must be defined before it is loaded with data or accessed by a processing program. VSAM data sets can be defined using either IDCAMS or JCL. Defining a VSAM Data Set with IDCAMS Continued… Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts DASD

22 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 22 The DEFINE CLUSTER function of IDCAMS is used to give the cluster a name and describe its characteristics. Listed below are some of the characteristics that can be specified during a DEFINE CLUSTER operation: Defining a VSAM Data Set with IDCAMS (cont’d) Cluster name Names of the data and index components Volume(s) on which the data set is to reside Space requirements of the data set Record size Position and length of the key field for KSDS Retention period Data set passwords Data set type Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts

23 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 23 Passwords are implemented to control access to data sets and other system resources. When a data set is defined, up to four passwords, each representing a different level of protection, can be defined. You can assign one password to control read access. Another password can be assigned for update access. Passwords Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts Password DASD VSAM Program UpdateRead

24 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 24 Once a data set has been defined, it needs to be loaded with data. The IDCAMS REPRO function is used for initial loading of a data set. The REPRO function can be used to: Load a VSAM data set from a SAM, ISAM or another VSAM data set Copy a VSAM data set to a SAM or VSAM but not to an ISAM data set Initial Loading Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts

25 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 25 IDCAMS can be used to perform a variety of data set management functions. Listed below are some of the commonly used IDCAMS functions: PRINT – Prints a VSAM data set ALTER – Changes certain attributes of a VSAM data set LISTCAT – Lists data set attribute and statistical information DELETE – Deletes a data set Other IDCAMS functions Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts

26 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 26 The advantages of VSAM are: VSAM supports more data set types Simplifies record processing Supports a variety of I/O techniques Provides greater efficiency for the application programs and for the overall environment The major limitation of VSAM is: Its data sets must reside on DASD. They cannot be created on tape. Advantages and Limitations of VSAM Unit: VSAM Concepts and Terms Topic: Access Method Services Concepts

27 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 27 Unit: Key-Sequenced Data Sets Topic: KSDS Organization and Storage Concepts Index Data Highest Level Index Record Continued… The index component of a KSDS has the following features: The index component is divided into control intervals Each index control interval is treated as a single record that is divided into index entries The index records resemble a tree structure with a single index record at the highest level The Index Component

28 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 28 Unit: Key-Sequenced Data Sets Topic: KSDS Organization and Storage Concepts The Index Component (cont’d) There are two types of index records. They are: Index Set: It consists of the records in the highest level of the index Sequence Set: It consists of the records in the lowest level of the index

29 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 29 Continued… Concepts Unit: Key-Sequenced Data Sets Topic: KSDS Processing Options 1726365054667499 08091114 18192526 27303133 37404347 51525354 55565759 67697073 75848890 Current Record Current Index Entry Consider a KSDS shown in the above diagram, which is being processed sequentially. Assume that the processing program has read all the records up to the record with key 37. The indicated sequence set record and data control interval would currently be in virtual storage. In response to the next sequential read request, VSAM will return the record at the current position. In this case, it would return the record with key 40. Sequential Access of Records (cont’d)

30 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 30 Continued… Concepts Unit: Key-Sequenced Data Sets 1726365054667499 08091114 18192526 27303133 37404347 51525354 55565759 67697073 75848890 Current Record Current Index Entry Once the last record in a control interval has been returned to the processing program, VSAM uses the next entry in the sequence set record to retrieve the next control interval from the present control area. Once the last control interval in the control area has been processed, VSAM uses the horizontal pointer in the sequence set record to retrieve the next sequence set record. Sequential Access of Records (cont’d) Topic: KSDS Processing Options

31 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 31 Continued… Concepts Unit: Key-Sequenced Data Sets 08 5099 26506699 1726365054667499 091114273031335152535467697073 18192526374043475556575975848890 Searching for a record with a key value of 53 A KSDS can process records randomly by supplying the key of the desired records. Consider the KSDS index and data components illustrated in the above diagram. Random Access of Records Topic: KSDS Processing Options

32 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 32 Continued… Concepts Unit: Key-Sequenced Data Sets 08 5099 26506699 1726365054667499 091114273031335152535467697073 18192526374043475556575975848890 Searching for a record with a key value of 53 Suppose the record key supplied by the processing program is 53. Each time a random request is issued, VSAM begins by retrieving the highest level index record and searching through its entries. Random Access of Records (cont’d) Topic: KSDS Processing Options

33 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 33 Continued… Concepts Unit: Key-Sequenced Data Sets 08 5099 26506699 1726365054667499 091114273031335152535467697073 18192526374043475556575975848890 Searching for a record with a key value of 53 VSAM examines the key value in each entry until it finds a key which is greater than or equal to the desired key. In this example, VSAM will stop at the second entry in the highest level index record (53 is greater than 50 but less than 99). Random Access of Records (cont’d) Topic: KSDS Processing Options

34 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 34 Random Access of Records (cont’d) Continued… Concepts Unit: Key-Sequenced Data Sets 08 5099 26506699 1726365054667499 091114273031335152535467697073 18192526374043475556575975848890 Searching for a record with a key value of 53 Using the corresponding pointer, the next lower level index record is retrieved. This record is processed until a key which is greater than or equal to the desired key is found. Topic: KSDS Processing Options

35 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 35 Random Access of Records (cont’d) Continued… Concepts Unit: Key-Sequenced Data Sets 08 5099 26506699 1726365054667499 091114273031335152535467697073 18192526374043475556575975848890 Searching for a record with a key value of 53 Eventually, the search will lead to a sequence set record. Within the record, VSAM locates the first key having a key value greater than or equal to the key value of the desired record. Topic: KSDS Processing Options

36 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 36 Random Access of Records (cont’d) Continued… Concepts Unit: Key-Sequenced Data Sets 08 5099 26506699 1726365054667499 091114273031335152535467697073 18192526374043475556575975848890 Searching for a record with a key value of 53 The pointer in this entry is used to retrieve a data control interval. VSAM searches the control interval sequentially, for the desired record. If the record is present, VSAM returns it to the processing program. If not, VSAM signals a record-not- found condition. Topic: KSDS Processing Options

37 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 37 Random Access of Records (cont’d) Continued… Concepts Unit: Key-Sequenced Data Sets 08 5099 26506699 1726365054667499 091114273031335152535467697073 18192526374043475556575975848890 Searching for a record with a key value of 53 The pointer in the index records define a path that VSAM follows to locate a record. The path VSAM would follow in this example is illustrated in the above diagram. Topic: KSDS Processing Options

38 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 38 VSAM 377 Vert, Pntr. 619 Vert. Pntr 800 Vert. Pntr. 280 Vert, Pntr. 327 Vert. Pntr 377 Vert. Pntr. 469 Vert, Pntr. 619 Vert. Pntr … ….….700 Vert, Pntr. 800 Vert. Pntr …… Index Set Sequence Set Horiz. Pntr. Horiz. Pntr. 627 642 658 675 700 251 269 280 FREE 312 318 327 FREE 345 346 377 FREE 394 400 449 469 FREE 500 502 598 617 619 717 722 746 748 800 FREE Control Interval Control Area

39 MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved. Page 39 377 Vert, Pntr. 619 Vert. Pntr 700 Vert. Pntr. 280 Vert, Pntr. 327 Vert. Pntr 377 Vert. Pntr. 469 Vert, Pntr. 598 Vert. Pntr 619 Vert. Pntr. Index Set Sequence Set Horiz. Pntr. Horiz. Pntr. 251 269 280 FREE 345 346 377 FREE 394 400 410 449 469 500 502 598 FREE Control Area 658 Vert, Pntr. 700 Vert. Pntr Vert. Pntr … 627 642 658 FREE Control Area 800 Vert. Pntr. Sequence Set 730 Vert, Pntr. 800 Vert. Pntr Vert. Pntr. … FREE Control Area 312 316 318 327 FREE 617 618 619 FREE 675 680 700 FREE 746 748 800 FREE 717 722 730 FREE Horiz. Pntr. Control Interval Split Control Area Split VSAM


Download ppt "MVS/ESA Fundamentals of VSAM © Copyright IBM Corp., 2000, 2004. All rights reserved."

Similar presentations


Ads by Google