Master Mainframe Technologies - COBOL, JCL, DB2, VSAM, CICS & More
ABEND Codes SQLCODEs File Status Interview Prep Contact
📄 VSAM

VSAM Alternate Indexes

Advanced 🕑 15 min read 👁 0 views

15

Code Example


## VSAM Alternate Indexes

Allow access to KSDS data by secondary keys.

### What is an Alternate Index?
- Secondary access path
- Can have duplicate keys
- Requires PATH definition
- Must be built and maintained

### Components
1. **Base Cluster:** Original KSDS
2. **Alternate Index:** AIX cluster
3. **Path:** Links AIX to base

### Creating AIX

1. DEFINE ALTERNATEINDEX
2. BLDINDEX to populate
3. DEFINE PATH

### AIX Options
- UNIQUEKEY: No duplicates
- NONUNIQUEKEY: Duplicates allowed
- UPGRADE: Auto-update with base

### COBOL Usage
Each path = separate SELECT