
In this class, we introduce the fundamentals of VSAM and understand how VSAM fits into the Mainframe file system. We cover ESDS, KSDS, RRDS and LDS at a high level, along with VSAM clusters and their basic components. We also compare QSAM and VSAM and understand why VSAM KSDS is used for faster and random access to data.
Topics covered:
Introduction to VSAM
QSAM vs VSAM
ESDS, KSDS, RRDS & LDS
VSAM Cluster and its components
Data and Index components
Basic access methods
Practical use cases of VSAM files
In this class, we understand the key differences between QSAM datasets and VSAM clusters and why VSAM is designed differently for storing and accessing data.
We introduce the Control Interval (CI) and Control Area (CA) concepts and understand how VSAM stores records within CIs and organizes CIs within a CA.
Topics covered:
QSAM Dataset vs VSAM Cluster
Block vs Control Interval (CI)
How records are stored in a CI
VSAM Buffer and CI retrieval
CI size and record capacity
Control Area (CA)
Relationship between CI and CA
Practical examples to understand CI/CA clearly
In this class, we introduce ESDS (Entry Sequenced Data Set) and understand how it is used in Mainframe applications. We discuss its characteristics, usage, and how it differs from a traditional PS file.
We then move into ESDS cluster creation, covering the important cluster attributes and IDCAMS DEFINE CLUSTER options. A sample JCL is also explained to understand how an ESDS cluster is defined and created.
Topics covered:
ESDS – Entry Sequenced Data Set
ESDS vs PS File
ESDS usage in online applications
ESDS cluster and data component
ESDS cluster attributes
Record size and CI size
FREESPACE and NONINDEXED
SHAREOPTIONS and REUSE
IDCAMS DEFINE CLUSTER
JCL for ESDS cluster creation
Practical preparation for ESDS Part-B
Next Class: ESDS Part-B – COBOL-VSAM Practical
In this practical session, we work hands-on with an ESDS (Entry Sequenced Data Set) from cluster creation to COBOL program execution.
We first use IDCAMS to define and create the ESDS cluster, and then develop a COBOL-VSAM program to work with the ESDS file. The session focuses on the practical steps required to create, define, compile, and execute an ESDS application.
Topics covered:
Define and create an ESDS cluster using IDCAMS
Understand the ESDS cluster and DATA component
Prepare the required JCL
COBOL-VSAM file definition
COBOL SELECT and FD for ESDS
Open and access an ESDS file
Write records to an ESDS
Compile and execute the COBOL program
End-to-end ESDS practical execution
This session is completely hands-on, connecting the ESDS theory from Part-A with an actual COBOL-VSAM implementation.
In this hands-on session, we continue working with ESDS using COBOL-VSAM. We develop a COBOL program to access the ESDS file, write records, compile the program, and execute it using JCL.
Topics covered:
COBOL-VSAM program for ESDS
SELECT and FD definitions
ESDS record layout
Open and write records
COBOL program compilation
JCL for program execution
Execute and verify the records written to ESDS
End-to-end ESDS practical
In this hands-on session, we continue our ESDS practical by developing a COBOL-VSAM program to read records from an ESDS cluster.
We understand how to define the ESDS file in COBOL, open the file in input mode, read records sequentially, handle the end-of-file condition, and display the records retrieved from the ESDS cluster.
Topics covered:
COBOL-VSAM program for reading ESDS
ESDS SELECT and FD definitions
Open ESDS in INPUT mode
Sequential reading of ESDS records
READ and AT END processing
File status checking
Displaying records read from ESDS
Compile and execute the COBOL program
Verify the ESDS records through program output
Focus: A complete hands-on ESDS Read → Compile → Execute → Verify practical.
In this class, we begin the KSDS (Key Sequenced Data Set) topic and understand why KSDS is used for random access to records.
We discuss how to create a KSDS cluster using IDCAMS and go through the important cluster parameters, including the primary key definition, CI size, record size, sharing options, and freespace.
Topics covered:
Why we use KSDS
KSDS cluster creation using IDCAMS
INDEXED and KEYS
Key length and key offset
Data and Index components
CONTROLINTERVALSIZE
RECORDSIZE
SHAREOPTIONS
FREESPACE(10,10)
CI Split and the importance of freespace
Control Area (CA) and Control Intervals (CI)
ESDS vs KSDS freespace concept
Next: We will continue with COBOL-KSDS programming and practical implementation.
In this class, we continue with KSDS Part-B and focus on the changes required to develop a COBOL program for a KSDS file.
We understand how KSDS differs from a sequential file in COBOL and study the important file operation statements used to access and update KSDS records.
Topics covered:
COBOL-KSDS program structure
ORGANIZATION IS INDEXED
RECORD KEY
Sequential, Random and Dynamic access
KSDS OPEN modes
WRITE operation
Sequential READ
Random READ using the key
REWRITE operation
FILE STATUS and important status codes
Rules and sequence of operations for KSDS
In this class, we move into the KSDS Practical – Part-A and implement our first real KSDS application.
We start by creating the KSDS Loan Master cluster using IDCAMS, including the key definition, CI size, freespace, DATA and INDEX components.
We then develop and execute a COBOL-KSDS program that reads new loan account details from a PS input file and writes the records into the KSDS cluster.
Topics covered:
KSDS practical application flow
Define KSDS cluster using IDCAMS
KEYS(LENGTH,OFFSET)
FREESPACE(CI,CA)
DATA and INDEX components
Create the required copybook
COBOL-KSDS program
ORGANIZATION IS INDEXED
RECORD KEY
Open KSDS in OUTPUT mode
Write records to KSDS
WRITE ... INVALID KEY
Input record validation
Compile and execute the program
Verify the KSDS output
Practical flow:
PS Input File → COBOL-KSDS Program → KSDS Loan Master → WRITE
This class focuses on actually building and loading a KSDS cluster, rather than only discussing the theory.
In this class, we continue with the KSDS Practical – Part-B and work on reading and updating records in the KSDS Loan Master cluster.
We use a PS file containing EMI payment details as input. The COBOL-KSDS program uses the loan account number as the KSDS key, performs a random READ, and, when the account is found, updates the outstanding amount and REWRITEs the record.
Topics covered:
KSDS READ practical
Dynamic access mode
Random READ using the record key
READ ... INVALID KEY
Finding an existing loan account
Updating the outstanding amount
REWRITE operation
KSDS opened in I-O mode
File status handling
COBOL program execution using JCL
Verifying the KSDS after the update using IDCAMS
Practical flow:
PS EMI File → COBOL-KSDS Program → Random READ → Update Record → REWRITE → Verify KSDS
This class gives you hands-on experience with a very common KSDS application scenario — finding an existing master record and updating it based on a transaction/EMI input file.
In this class, we introduce AIX (Alternate Index) and understand how it can be used to access a KSDS cluster randomly using an alternate key.
We start with the need for AIX and understand the difference between the primary key of a KSDS and an alternate key such as Customer ID.
Topics covered:
What is AIX (Alternate Index)?
Why do we need AIX?
Accessing a KSDS using an alternate field
Primary Key vs Alternate Key
AIX DATA and INDEX components
DEFINE AIX
RELATE – connecting AIX with the KSDS cluster
KEYS(LENGTH,OFFSET)
NONUNIQUEKEY and duplicate alternate keys
AIX RECORDSIZE
UPGRADE option
What is a PATH?
Defining a PATH using PATHENTRY
What is BUILDINDEX?
Why BLDINDEX is required
Building the initial AIX from an existing KSDS
How future KSDS changes are synchronized with AIX
The class focuses on understanding the complete AIX structure and the relationship between KSDS → AIX → PATH → BUILDINDEX before moving into the practical implementation.
Next class: AIX Practical – Define AIX, Build Index & Access KSDS using the Alternate Key.
In this class, we move into the AIX Practical and implement the concepts discussed in the previous theory session.
We create an Alternate Index (AIX) for the KSDS Loan Master and connect it using a PATH. We then use BLDINDEX to build the AIX entries from the existing KSDS data.
The practical also demonstrates how a COBOL program can access the KSDS using both the Primary Key (Loan Account Number) and the Alternate Key (Customer ID).
Topics covered:
Define AIX using IDCAMS
Connect AIX with the KSDS using RELATE
Define KEYS(LENGTH,OFFSET)
Handle duplicate alternate keys using NONUNIQUEKEY
Use the UPGRADE option
Define the AIX PATH using PATHENTRY
Build the AIX using BLDINDEX
COBOL ALTERNATE KEY ... WITH DUPLICATES
Random READ using the primary key
Access using Customer ID as the alternate key
START and READ NEXT for alternate-key processing
Execute and verify the complete practical flow
Practical flow:
KSDS → AIX → PATH → BLDINDEX → COBOL Program → Primary / Alternate Key Access
This class gives hands-on experience with how AIX is actually implemented and used with a KSDS application.
In this class, we move from VSAM batch processing to Online Processing using CICS and understand how a COBOL-CICS-VSAM application works.
We begin with a quick recap of AIX, Primary Key, Alternate Key, Random READ and Dynamic READ, and then understand how a user interacts with a Mainframe online application.
Topics covered:
AIX recap – Primary & Alternate Key access
Random READ and Dynamic READ
Why CICS is used for online processing
User → BMS Screen → CICS → COBOL-CICS Program → VSAM/DB2 flow
COBOL-CICS-VSAM application structure
Changes required in a COBOL program for CICS
CICS file commands
READ, BROWSE, WRITE, REWRITE and DELETE
Batch file processing vs CICS file processing
CICS translation and compilation flow
DFHECP1$, COBOL compiler and Link-edit
CICS control tables – PPT, PCT, FCT and RCT
File Control Table (FCT) and VSAM file definition
CICS file opening and allowed operations
This class builds the theory foundation required before starting practical COBOL-CICS-VSAM programming.
In this class, we move into the COBOL + CICS + VSAM Practical and build an online application using a BMS MAP, COBOL-CICS program, and KSDS VSAM file.
We practically demonstrate how a user interacts with the CICS screen and how the COBOL-CICS program communicates with the VSAM file.
Topics covered:
BMS MAP and screen communication
SEND MAP and RECEIVE MAP
COBOL-CICS program structure
CICS READ operation on KSDS
CICS WRITE operation to KSDS
Input validation before writing a record
CICS response-code handling
Loan Account Number validation
Customer ID validation
Loan, EMI and Outstanding Balance validation
Handling record not found and other file errors
CICS RETURN and transaction flow
Complete LOAN online transaction flow
Practical understanding of BMS → CICS → COBOL → VSAM
We also work with the actual LOANSET BMS MAPSET and VSAMPGM6 COBOL-CICS program, making this a practical, end-to-end COBOL-CICS-VSAM application exercise.
Practical Flow:
USER → BMS SCREEN → CICS → COBOL-CICS PROGRAM → KSDS VSAM FILE → CICS → SCREEN
Welcome to the VSAM Training Course!
This course takes you from VSAM fundamentals to practical COBOL-VSAM programming, with a strong focus on real Mainframe application scenarios. This course is suitable for Mainframe freshers, COBOL developers, experienced professionals, production support engineers and anyone preparing for Mainframe interviews.
You will learn:
VSAM fundamentals and file concepts
QSAM vs VSAM
ESDS, KSDS, RRDS and LDS
Control Interval (CI) and Control Area (CA)
ESDS cluster creation using IDCAMS
COBOL-ESDS programming and READ/WRITE operations
KSDS cluster definition using IDCAMS
KSDS DATA and INDEX components
Keys, key offset and FREESPACE
CI/CA split concepts
COBOL-KSDS programming
Sequential, Random and Dynamic access
KSDS READ, WRITE and REWRITE operations
Alternate Index (AIX)
PATH and PATH-based access
File status handling
JCL execution and practical verification
COBOL-CICS-VSAM programs and real-time file processing
The course follows a simple practical approach:
Understand → Define → Code → Compile → Execute → Verify
You won't just learn what VSAM is—you'll understand how VSAM is actually used with COBOL, CICS and JCL in Mainframe applications.
This course is suitable for Mainframe freshers, COBOL developers, experienced professionals, production support engineers and anyone preparing for Mainframe interviews.
Course Philosophy
Don't just learn VSAM theory. Learn how VSAM is actually used in a Mainframe application.
Let's learn VSAM the practical way!