Exforsys.com
 

Sponsored Links

 

MainFrame Tutorials

 
Home Tutorials MainFrame
 

VSAM Structure

 

VSAM Structure

In this Mainframe tutorial, you will learn about VSAM Structure,  four major areas of VSAM structure, what is VSAM cluster, VSAM components, Defining VSAM cluster and Example for defining VSAM clusters.



There are four major areas in the structure of VSAM. They are:


  • The Master catalog
  • The User catalog
  • The Data space
  • The file also called as cluster

What is VSAM Cluster?

VSAM dataset which we have seen in detail in our earlier section when defined logically takes up the form as a VSAM cluster. Before proceeding to see about VSAM cluster it is very important to know primarily what a cluster is. A cluster nothing but a association of the index, sequence set and data portions of the dataset. The operating system takes the responsibility of giving program access to the cluster by which access to given to all parts of the dataset simultaneously. The space occupied by a VSAM cluster is divided into contiguous areas called control intervals (CI) and about this concept we have seen in detail in our earlier section.


There are two main components present in a VSAM cluster and they are as given below:


• The data component
• The index component


Data Component of VSAM Cluster: Data records are present in the data component of a VSAM cluster.


Index Component of VSAM Cluster: Index records are present in the index component of a VSAM key-sequenced cluster.


Defining VSAM cluster:

The command used for defining the VSAM cluster is DEFINE CLUSTER which defines the entry name, name of the catalog to contain this definition and its password, Organization detail like sequential, indexed, or relative, Device and volumes that the data set will occupy, Space required for the data set, Record size and control interval sizes, for future access Passwords if needed.


The syntax of this command is as below:


DEFINE CLUSTER (NAME(entryname)
BLOCKS(number)
VOLUMES(volser)
RECORDSIZE(average maximum)
[INDEXED|NONINDEXED|NUMBERED]
[FREESPACE(cipercent capercent)]
[KEYS(length offset)]
[READPW(password)]
[FOR(days)|TO(date)]
[UPDATEPW(password)])
[CATALOG(catname[/password]


In the above syntax


NAME attribute denotes the entry name which is the name of the cluster to be defined. The naming conventions or the rules for naming this attribute takes up the same rules and convention as defined for naming a catalog.


BLOCKS attribute BLOCKS denotes a number and the corresponding number specifies the number of blocks for the cluster. 


VOLUMES parameter denotes the volumes to contain the cluster.


RECORDSIZE parameter has two values:


  • average
  • maximum

The average specifies the average length of the logical records in the file and the maximum denotes the length of the records.


INDEXED|NONINDEXED|NUMBERED parameter can take three values INDEXED, NONINDEXED or NUMBERED depending upon the type of dataset. That is the INDEXED option is given if it is key-sequenced files, for entry-sequenced files the NONINDEXED option and for relative-record files the NUMBERED option is required. The default value of this parameter is INDEXED.


FREESPACE parameter specifies the amount of free space per control interval and per control area for a key-sequenced file. The value of this parameter is specified in percentage. The default value of this parameter is 0 percentage.


KEYS The value of this parameter specifies the size of the key field which in other words depicts the length and the offset of the key from the beginning of the record. The range of value that can be taken by this parameter are from 1 to 255 bytes. It should be noted that the parameter takes its presence only in key-sequenced files.


READPW The value of this parameter denotes the password of read level.


UPDATEPW The value of this parameter denotes the password of update level. 


FOR|TO The value of this parameter specifies the amount of time for retaining the file. The default value taken by this parameter is 0 days.


CATALOG parameter denotes the catalog under which this file will be defined. 


When the VSAM cluster is defined by using the DEFINE CLUSTER command as above an entry gets created in an integrated VSAM catalog.


Example for defining VSAM clusters


DEFINE CLUSTER-
(NAME(SECOND.EXFORSYS)-
VOLUMES(DCE001)-
FREESPACE(20 5)-
BLOCKS(80)-
INDEXED-
KEYS(5 15)-
RECORDSIZE (20 50)-
CATALOG(T1.E2.Test.CATALOG/MASTER)



In the above example cluster SECOND.EXFORSYS is defined, which allocates DCE001 volumes for the corresponding cluster with 20 percentage of free area per control interval and 5% of free area per control area for the cluster. The above cluster SECOND.EXFORSYS in example is defined to occupy 80 blocks and the type is defined as INDEXED which is denoted for key-sequenced files. Being INDEXED the default value of the parameter one need not define this value also. The length of the key field is 20 characters and this field is placed at an offset of 15 characters from the beginning of the record as defined above. The average length of the logical records in the file for the cluster defined takes the value of 20 and the allowable maximum length of the record in the file for the cluster defined is 50.The file is placed in the catalogue  T1.E2.Test.CATALOG/MASTER.



Read Next: VSAM Control Interval and Control Area



 

 

Comments


N.Amrutha said:

  thanks a lot for helping me to understand the topic. this is very helpful to the beginners. I am very much thankful to the people who made to understand VSAM easily.
October 17, 2007, 8:08 am

sumankumar said:

  hi,
thanks a lot for material available here but it would be more better if additional information is presented on realtime application programs.
October 24, 2008, 3:46 pm

Praveen said:

  I think the parameter KEYS(5 15) indicates the key of he record is just 5 bytes from an offset of 15. But you mentioned the key length to be 20 bytes. could you please verify and confirm me?
January 15, 2010, 9:05 pm

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2010 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape