Skip to Content
Interview Q&A

500+ Mainframe Interview Questions & Answers

Master COBOL, JCL, DB2, CICS, and VSAM interview preparation with topic-wise questions, detailed answers, real-world scenarios, and frequently asked interview questions from top IT companies.

  • 500+ Interview Questions
  • Beginner to Advanced Level
  • Real-Time Scenario Based Questions
  • IBM Mainframe Technologies Covered
  • Updated for Current Industry Standards
Professional mainframe interview preparation platform featuring COBOL, JCL, DB2, CICS, and VSAM learning resources with technical documentation and career development focus.
100+
Questions
5
Technologies Covered
Freshers to 15+ Years
Experience Levels
Top IT Companies
Frequently Asked

Mainframe Interview Q&A

Collection of frequently asked interview questions and answers for COBOL, JCL, DB2, CICS and VSAM.

COBOL Questions (30)

Expand all

COBOL (Common Business-Oriented Language) is a high-level programming language designed for business applications, especially for data processing.

The divisions are Identification, Environment, Data, and Procedure.

COMP is binary storage. COMP-3 is packed-decimal storage, commonly used for financial fields.

It is a part of the Data Division used to define internal variables used during program execution.

PERFORM is used to execute paragraphs/sections and to build structured logic such as loops and modular routines.

REDEFINES lets two or more data items share the same storage area, useful for viewing the same bytes in different formats.

SEARCH performs a linear (sequential) search. SEARCH ALL performs a binary search and requires the table to be sorted on the search key.

An 88 level defines condition names (named values) for a field, improving readability (e.g., WS-STATUS-OK, WS-STATUS-ERROR).

Copybooks are reusable code/data definitions included using the COPY statement. They standardize layouts (e.g., file records, DB2 host structures) across programs.

EVALUATE is like a multi-branch conditional (similar to switch/case). It improves readability compared to nested IF statements.

INDEXED BY creates an index for efficient table processing.

Example:

05 EMP-NAME PIC X(20)
   OCCURS 100 TIMES
   INDEXED BY EMP-IDX.

SEARCH SEARCH ALL
Linear Search Binary Search
Slower Faster
No sorting required Table must be sorted

CALL transfers control from one program to another.

Example:

CALL 'SUBPROG'

LINKAGE SECTION is used to receive data from the calling program.

The Linkage Section is used for communication between programs.

Example:

LINKAGE SECTION.
01 LK-CUSTOMER-ID PIC X(10).

Static CALL (program name is fixed):

CALL 'PAYROLL'

Dynamic CALL (program name is determined at runtime):

CALL WS-PROGRAM-NAME

EVALUATE works like a CASE statement.

Example:

EVALUATE WS-GRADE
   WHEN 'A'
      DISPLAY 'EXCELLENT'
   WHEN 'B'
      DISPLAY 'GOOD'
   WHEN OTHER
      DISPLAY 'AVERAGE'
END-EVALUATE

CONTINUE does nothing and passes control to the next statement.

NEXT SENTENCE transfers control to the next period (.).

In modern COBOL, CONTINUE is generally preferred.

SSRANGE is a compiler option used to detect array index errors during execution.

Benefits: Prevents table overflow and helps debugging.

Inline PERFORM executes statements without creating a separate paragraph.

Example:

PERFORM
   ADD 1 TO WS-COUNT
   DISPLAY WS-COUNT
END-PERFORM

Batch Program Online Program
Runs in bulk User interactive
Uses files Uses transactions
Scheduled execution Real-time execution
Usually under JCL Usually under CICS

Examples: Salary processing → Batch, ATM withdrawal → Online CICS program.

CALL BY REFERENCE: The called program receives the actual memory address.

CALL 'SUBPROG' USING WS-AMOUNT

Changes made in the subprogram affect the calling program.

CALL BY CONTENT: The called program receives a copy of the data.

CALL 'SUBPROG' USING BY CONTENT WS-AMOUNT

Changes made in the subprogram do not affect the original data.

The INITIAL clause causes Working-Storage items to be initialized whenever the program is called.

Example:

PROGRAM-ID. TESTPROG IS INITIAL.

Benefit: Ensures fresh data values for each execution.

INDEXSUBSCRIPT
Internal displacement valueNumeric occurrence number
FasterSlightly slower
Used with SET statementUsed directly

Examples:

Subscript:

MOVE EMP-NAME(5) TO WS-NAME

Index:

SET EMP-IDX TO 5

SEARCH ALL performs a binary search on a table.

Requirements:

  • Table must be sorted
  • OCCURS clause with INDEXED BY

Example:

SEARCH ALL EMP-TABLE
   WHEN EMP-ID(EMP-IDX) = WS-ID
      DISPLAY 'FOUND'
END-SEARCH

Benefits: Faster than SEARCH, efficient for large tables.

INSPECT is used to count, replace, or convert characters within a string.

Example (Count):

INSPECT WS-NAME
   TALLYING WS-COUNT
   FOR ALL 'A'

Example (Replace):

INSPECT WS-NAME
   REPLACING ALL 'A' BY 'X'

STRING combines multiple fields into one field.

Example:

STRING WS-FIRST-NAME
       SPACE
       WS-LAST-NAME
INTO WS-FULL-NAME
END-STRING

Output: PUNIT KUMAR

UNSTRING splits a string into multiple fields.

Example:

UNSTRING WS-NAME
   DELIMITED BY SPACE
   INTO WS-FIRST-NAME
        WS-LAST-NAME
END-UNSTRING

Input: PUNIT KUMAR → Output: PUNIT / KUMAR

Reference Modification allows accessing part of a field.

Syntax: field(start:length)

Example:

MOVE WS-NAME(1:5) TO WS-FIRST

If WS-NAME = 'PUNITKUMAR' then WS-FIRST = 'PUNIT'.

SYNC aligns data items on natural machine boundaries to improve performance.

Example:

01 WS-COUNT PIC S9(4) COMP SYNC.

Benefits: Faster processing and better hardware alignment.

CONTINUE is a no-operation statement that passes control to the next statement.

IF WS-FLAG = 'Y'
   CONTINUE
END-IF

EXIT is used to exit a paragraph or indicate the end of a section.

EXIT.

Difference:

CONTINUEEXIT
Executable statementParagraph/section terminator
Does nothingTransfers control
Used in logic blocksUsed in program structure

JCL Questions (30)

Expand all

JCL (Job Control Language) defines and runs batch jobs on z/OS: programs to execute, datasets to use, and resource requirements.

The main types are JOB, EXEC, and DD statements.

It identifies the job and provides job-level parameters such as class, MSGCLASS, and notification options.

Double slash (//) indicates the start of a JCL statement.

DD (Data Definition) links a DDNAME to a dataset, file, or device and supplies allocation/access information.

A PROC (procedure) is reusable JCL stored in a cataloged procedure library. It helps standardize job steps and reduces duplication.

COND is used to conditionally bypass job steps based on return codes from previous steps.

SPACE specifies how much disk space to allocate for a new dataset (primary, secondary, and unit type such as tracks/cylinders).

DISP controls dataset status and what to do at step end (e.g., NEW/MOD/OLD/SHR and KEEP/CATLG/DELETE).

JOBLIB applies to all steps in the job. STEPLIB applies only to the specific step where it is coded.

Errors are commonly handled using return codes (RC) from steps, along with JCL controls like COND, IF/THEN/ELSE, and restart options. Programs can also set meaningful RCs so JCL can take the correct action.

DISP defines dataset status and what happens after job completion.

Syntax: DISP=(status,normal-action,abnormal-action)

Example: DISP=(NEW,CATLG,DELETE)

Meaning: NEW → Create dataset, CATLG → Catalog if job succeeds, DELETE → Delete if job fails.

StatusMeaning
NEWCreate dataset
OLDExclusive use
SHRShared use
MODAppend data

Example: DISP=SHR

GDG (Generation Data Group) is a collection of related datasets with automatic version management.

MY.FILE.GDG(+1)
MY.FILE.GDG(0)
MY.FILE.GDG(-1)

+1 = New generation, 0 = Current generation, -1 = Previous generation.

PROC is a reusable set of JCL statements.

Example:

//MYPROC PROC
//STEP1 EXEC PGM=SORT
//PEND

Usage: //JOB1 EXEC MYPROC

Benefits: Reusability, reduced coding effort.

In-Stream PROCCataloged PROC
Inside JCLStored in PROC library
Job specificReusable across jobs
Less flexibleWidely used

COND controls execution of steps based on previous return codes.

Example: COND=(4,LT)

Meaning: Skip current step if previous return code is less than 4.

A return code indicates job execution status.

RCMeaning
0Successful
4Warning
8Error
12Serious Error
16Severe Error

REGION specifies memory allocation for a job or step.

Example: REGION=0M

Meaning: Use all available memory.

A temporary dataset exists only during job execution.

Example: DSN=&&TEMPFILE

Characteristics: Not cataloged, deleted automatically after job completion.

Symbolic parameters allow dynamic values in procedures.

Example:

//MYPROC PROC PGMNAME=COBPROG
//STEP1 EXEC PGM=&PGMNAME

Usage: //EXECPROC EXEC MYPROC,PGMNAME=TESTPROG

Used to restart a failed job from a specific step.

Example: RESTART=STEP3

Benefit: Avoids rerunning completed steps.

IEBGENER is used to copy sequential datasets.

Example: //STEP1 EXEC PGM=IEBGENER

Uses: Dataset copy, backup creation, printing.

IEBCOPY copies partitioned datasets (PDS).

Example: //STEP1 EXEC PGM=IEBCOPY

Uses: Copy PDS members, compress PDS.

SORT is used to sort datasets.

Example: //STEP1 EXEC PGM=SORT

Sort control: SORT FIELDS=(1,10,CH,A)

Meaning: Sort first 10 characters in ascending order.

IDCAMS is used for VSAM dataset operations.

Example: //STEP1 EXEC PGM=IDCAMS

Common commands: DEFINE, DELETE.

IEFBR14 is a “do-nothing” IBM utility (it simply ends with RC=0). It’s commonly used to create or delete datasets via DD statements and DISP.

Example (create):

//STEP1 EXEC PGM=IEFBR14
//OUTDD DD DSN=MY.DATASET,DISP=(NEW,CATLG,DELETE),
//         SPACE=(TRK,(5,2)),UNIT=SYSDA

PARM passes parameters from JCL to the program (via the EXEC statement).

Example:

//STEP1 EXEC PGM=MYPROG,PARM='MODE=TEST,DATE=20260616'

The program reads the value from its runtime parameter area.

DD DUMMY tells the program there is no real input/output dataset (treated as empty input or discarded output).

DD * is used for in-stream data (data provided directly inside the JCL).

Examples:

//INP  DD DUMMY
//SYSIN DD *
  SORT FIELDS=(1,10,CH,A)
/*

SYSIN is typically used to provide control statements/input parameters to utilities (like SORT, IDCAMS, etc.).

SYSPRINT is typically used to capture reports/messages/output listings produced by utilities.

DB2 Questions (30)

Expand all

DB2 is IBM’s relational database management system used to store and manage data using SQL.

They include DDL (CREATE/ALTER/DROP), DML (SELECT/INSERT/UPDATE/DELETE), and utility commands depending on environment.

Normalization organizes tables to reduce redundancy and improve data integrity.

COMMIT makes changes permanent for the current unit of work.

DELETE can remove selected rows and is logged row-by-row. TRUNCATE removes all rows quickly with fewer logging details (depending on DB2 settings).

A cursor lets you process query results row-by-row, commonly used when a SELECT returns multiple rows in embedded SQL.

BIND creates an executable access path (package/plan) for SQL statements by preparing them for runtime execution.

CHAR is fixed-length (pads spaces). VARCHAR is variable-length and stores only the needed length up to its maximum.

An index speeds up data retrieval by providing an efficient access path to rows (at the cost of extra storage and maintenance on updates).

A package is the bound form of SQL for a single program (DBRM). A plan can include one or more packages and is used for execution.

A Tablespace is a physical storage structure that contains one or more tables.

Benefits: Organizes data storage, improves performance, simplifies space management.

Example:

CREATE TABLESPACE TS_EMP
IN DB_EMP;

An Index is a database object used to speed up data retrieval.

Example:

CREATE INDEX IX_EMP_ID
ON EMPLOYEE(EMP_ID);

Benefits: Faster SELECT queries, reduced table scans.

A Clustered Index determines the physical order of rows in a table.

Example:

CREATE UNIQUE INDEX IX_EMP
ON EMPLOYEE(EMP_ID)
CLUSTER;

Benefits: Faster range scans, improved sequential access.

A Cursor is used to process query results one row at a time.

Steps: DECLARE → OPEN → FETCH → CLOSE

Example:

DECLARE C1 CURSOR FOR
SELECT EMP_ID, EMP_NAME
FROM EMPLOYEE;

CursorSELECT INTO
Multiple rowsSingle row
Requires FETCHDirect retrieval
More processingSimpler

Example:

SELECT EMP_NAME
INTO :HV-NAME
FROM EMPLOYEE
WHERE EMP_ID = 100;

A Package contains executable SQL statements generated during the bind process.

Benefits: Better performance, SQL execution control, security management.

A Plan is an executable structure that references one or more packages.

Relationship: Application Program → Package → Plan

BIND creates a package or plan from SQL statements.

Example: BIND PACKAGE(...)

Benefits: Optimizes SQL, creates access paths.

REBIND regenerates access paths without recompiling the program.

Example: REBIND PACKAGE(PKGNAME)

When used: Statistics changed, performance tuning required.

RUNSTATS collects table and index statistics.

Example: RUNSTATS TABLESPACE DB1.TS1

Benefits: Better optimizer decisions, improved query performance.

EXPLAIN shows how DB2 will execute an SQL statement.

Example:

EXPLAIN PLAN FOR
SELECT * FROM EMPLOYEE;

Uses: Performance analysis, query tuning.

A Primary Key uniquely identifies each row in a table.

Example:

CREATE TABLE EMPLOYEE
(
 EMP_ID INTEGER PRIMARY KEY,
 EMP_NAME VARCHAR(50)
);

Rules: Unique, cannot be NULL.

A Foreign Key establishes a relationship between tables.

Example:

ALTER TABLE ORDERS
ADD CONSTRAINT FK_CUST
FOREIGN KEY (CUST_ID)
REFERENCES CUSTOMER(CUST_ID);

Referential Integrity ensures consistency between parent and child tables.

Benefits: Prevents orphan records, maintains data accuracy.

CHARVARCHAR
Fixed lengthVariable length
Wastes spaceSaves space
Faster accessFlexible storage

Example: NAME CHAR(20), CITY VARCHAR(50)

SQLCODE indicates the result of SQL execution.

SQLCODEMeaning
0Success
+100No rows found
-305NULL value error
-911Deadlock/Rollback

Example:

IF SQLCODE = 0
   DISPLAY 'SUCCESS'
END-IF

SQLCA (SQL Communication Area) stores SQL execution information for embedded SQL programs.

It contains fields such as SQLCODE, SQLSTATE, and diagnostic information about the last executed SQL statement.

A Deadlock occurs when two transactions wait indefinitely for resources locked by each other.

Example:

  • Transaction A → waits for Row B
  • Transaction B → waits for Row A

Result: DB2 rolls back one transaction (often SQLCODE -911 or -913).

A View is a virtual table based on one or more tables.

Example:

CREATE VIEW EMP_VIEW AS
SELECT EMP_ID,
       EMP_NAME
FROM EMPLOYEE;

Benefits: Security, simplified queries, data abstraction.

DELETETRUNCATEDROP
Removes selected rowsRemoves all rowsRemoves table
Can use WHERENo WHEREDeletes structure
Can rollbackLimited rollbackCannot recover easily

Examples:

DELETE FROM EMPLOYEE
WHERE EMP_ID = 100;

TRUNCATE TABLE EMPLOYEE;

DROP TABLE EMPLOYEE;

CICS Questions (30)

Expand all

CICS (Customer Information Control System) is a transaction processing monitor for high-volume online applications.

A CICS region is a running CICS environment (address space). Different regions can be used for dev/test/prod workloads.

A transaction is a unit of work started by a transaction ID that triggers program execution and resource access under CICS control.

LINK returns control to the caller after the called program completes. XCTL transfers control to another program and does not return.

BMS (Basic Mapping Support) maps define 3270 screen layouts and field attributes used by CICS applications.

COMMAREA is a communication area used to pass data between programs in CICS (commonly with LINK), typically up to 32 KB.

TSQ (Temporary Storage Queue) is used for temporary data and can be read randomly. TDQ (Transient Data Queue) is like a sequential queue used for messaging/logging.

CICS loads a program into memory when it is first invoked (via transaction). Subsequent invocations may reuse it depending on settings.

EIB (Execute Interface Block) is a system-provided control block containing runtime information such as transaction ID, task number, response codes, etc.

SEND MAP displays a BMS map to the terminal. RECEIVE MAP reads input data from the terminal into the application program.

COMMAREA (Communication Area) is used to pass data between two CICS programs.

Example:

EXEC CICS LINK
     PROGRAM('PROG2')
     COMMAREA(WS-COMMAREA)
     LENGTH(100)
END-EXEC

Benefits: Program-to-program communication, temporary data transfer, fast and efficient.

The maximum size of a COMMAREA is 64 KB (65,535 bytes).

For larger data transfers, IBM recommends using Channels and Containers.

LINKXCTL
Returns control to calling programDoes not return
Creates new logical levelReplaces current program
Similar to subroutine callSimilar to transfer control

Example:

EXEC CICS LINK PROGRAM('PROG2') END-EXEC
EXEC CICS XCTL PROGRAM('PROG2') END-EXEC

Channels and Containers are modern alternatives to COMMAREA.

  • Channel: collection of containers
  • Container: holds application data

Advantages: Can hold large data, easier management, recommended for modern CICS applications.

EIB (Execute Interface Block) is a control block automatically provided by CICS.

It contains transaction ID, task information, response codes, and terminal information.

Example:

IF EIBCALEN > 0
   DISPLAY 'DATA RECEIVED'
END-IF

EIBCALEN contains the length of data passed through COMMAREA.

Example:

IF EIBCALEN = 0
   DISPLAY 'FIRST TIME ENTRY'
END-IF

Usage: detect initial invocation, validate incoming COMMAREA.

HANDLE ABEND is used to handle abnormal program termination.

Example:

EXEC CICS HANDLE ABEND
     LABEL(ABEND-ROUTINE)
END-EXEC

Benefits: prevents transaction failure, enables custom error handling.

HANDLE CONDITION intercepts specific CICS exceptions.

Example:

EXEC CICS HANDLE CONDITION
     NOTFND(NOT-FOUND-PARA)
END-EXEC

If a record is not found, control goes to NOT-FOUND-PARA.

RESP is the primary response code and RESP2 provides detailed error information.

Example:

EXEC CICS READ
     FILE('CUSTFILE')
     INTO(WS-REC)
     RESP(WS-RESP)
     RESP2(WS-RESP2)
END-EXEC

RESPNOHANDLE
Application handles errorsSuppresses automatic error handling
RecommendedUsed in special cases
Easier debuggingMore coding required

Example:

EXEC CICS READ
     FILE('CUSTFILE')
     NOHANDLE
END-EXEC

TSQ (Temporary Storage Queue) is a queue used for temporary data storage.

  • Records can be read randomly
  • Data survives task termination

Example:

EXEC CICS WRITEQ TS
     QUEUE('TEMPQ')
     FROM(WS-DATA)
END-EXEC

TDQ (Transient Data Queue) is used for sequential processing of temporary data.

Types: Intra-partition TDQ, Extra-partition TDQ

Example:

EXEC CICS WRITEQ TD
     QUEUE('PRINTQ')
     FROM(WS-DATA)
END-EXEC

TSQTDQ
Random access possibleSequential access only
Read multiple timesUsually read once
Update allowedUpdate not allowed
Temporary storageSequential processing

BMS (Basic Mapping Support) is used to design CICS screens.

Components: Physical Map, Symbolic Map

Benefits: Screen formatting, user interaction, input validation.

SEND MAP displays the screen to the user.

Example:

EXEC CICS SEND MAP('CUSTMAP')
END-EXEC

RECEIVE MAP receives user input from the screen.

Example:

EXEC CICS RECEIVE MAP('CUSTMAP')
END-EXEC

MDT (Modified Data Tag) indicates whether a field has been modified.

MDTMeaning
ONField transmitted
OFFField not transmitted

Benefits: Reduces network traffic and improves performance.

PCT (Program Control Table) maps transaction IDs to programs.

Example:

Transaction: CUST → Program: CUSTPGM. When the user enters CUST, CICS executes CUSTPGM.

PPT (Processing Program Table) contains program definitions.

It stores details like program name, language, load information, and execution attributes.

PCTPPT
Stores transaction definitionsStores program definitions
Maps transaction to programControls program execution
Transaction-orientedProgram-oriented

A pseudo-conversational program ends after each user interaction and restarts when the user responds.

Typical flow:

  • SEND MAP
  • RETURN TRANSID
  • User enters data
  • Transaction restarts
  • RECEIVE MAP

Benefits: Saves memory, improves scalability, and is a standard design in modern CICS applications.

VSAM Questions (30)

Expand all

VSAM (Virtual Storage Access Method) is a z/OS data access method supporting KSDS, ESDS, RRDS and LDS dataset types.

KSDS, ESDS, RRDS, and LDS are the common VSAM dataset organizations.

KSDS supports keyed access (and sequential). ESDS is primarily sequential with access by relative byte address.

A control interval (CI) is the basic unit of I/O in VSAM.

A control area (CA) is a group of control intervals allocated together as a higher-level unit of VSAM storage.

A cluster is the VSAM definition that includes components like data and index (for KSDS) and identifies how the dataset is created and accessed.

An AIX provides an additional key for accessing records in a base cluster, enabling alternate key reads (with PATH defined for access).

FREESPACE reserves room in control intervals and control areas to reduce splits during inserts/updates, improving performance.

A CI split occurs when a CI runs out of space and records are redistributed. A CA split happens when the CA runs out of space and a new CA is allocated.

Typically with IDCAMS DEFINE CLUSTER (and related parameters such as RECORDSIZE, KEYS, FREESPACE, CISZ, etc.).

A Linear Data Set (LDS) is a VSAM dataset that does not contain records or keys. Data is stored as a sequence of bytes.

Characteristics: No record definition, no key fields, often used by DB2 for tablespaces and indexes.

Example:

DEFINE CLUSTER(NAME(DB2.LDS)
LINEAR)

A Key Range represents the lowest and highest key values stored in a KSDS dataset.

Example: Lowest Key: 1000, Highest Key: 9999

Benefits: Faster searches, efficient index navigation, improved performance during sequential processing.

No. The primary key of a KSDS record cannot be updated directly.

To change a key:

  • Read the record
  • Delete the existing record
  • Insert a new record with the new key

Reason: The key determines the physical and logical location of the record.

Dynamic Access allows an application to switch between sequential and random processing during execution.

Example: ACCESS MODE IS DYNAMIC

Benefits: Flexibility, better performance, useful in online applications.

By defining free space during dataset creation.

Example: FREESPACE(20 10)

Meaning: 20% free space in CI, 10% free space in CA. Benefits: Fewer splits, better performance.

Free Space is reserved empty space within a KSDS dataset to accommodate future inserts.

Example: FREESPACE(15 5)

Advantages: Reduces CI splits and improves insert performance.

An Alternate Index provides an alternate access path to a KSDS dataset.

Example: Primary Key: EMP_ID, Alternate Key: EMP_NAME

Benefits: Multiple search methods and faster retrieval.

A PATH connects an Alternate Index to its base cluster. Without PATH, applications cannot use the Alternate Index.

Structure: KSDS → AIX → PATH

UPGRADESET automatically updates the Alternate Index whenever the base cluster changes.

Example:

DEFINE ALTERNATEINDEX
UPGRADE

Benefit: Keeps AIX synchronized.

VERIFY synchronizes catalog information with the actual dataset.

Example: VERIFY FILE(MY.KSDS)

Used after: System failures, incomplete updates.

REPRO is used to copy VSAM and non-VSAM datasets.

Example:

REPRO -
INFILE(INPUT) -
OUTFILE(OUTPUT)

Uses: Data migration, backup, dataset loading.

EXPORT creates a backup of a VSAM cluster.

EXPORT -
OBJECTS(MY.KSDS)

IMPORT restores a previously exported cluster.

IMPORT -
INFILE(BACKUP)

LISTCAT displays information about VSAM datasets.

Example: LISTCAT ENT(MY.KSDS) ALL

Shows: CI size, CA size, record length, free space, and more.

KSDSESDS
Key-based accessSequential access
Supports updatesAppend-only records
Records retrieved by keyRecords retrieved by RBA

RBA (Relative Byte Address) identifies the physical location of a record in an ESDS dataset.

Example:

  • Record A → RBA 000000
  • Record B → RBA 000120

It is used for direct access in ESDS.

RBARRN
Relative Byte AddressRelative Record Number
Used in ESDSUsed in RRDS
Physical locationLogical record number

A Cluster is the complete VSAM dataset definition.

Contains: Data component, Index component (KSDS only).

Example:

DEFINE CLUSTER(NAME(CUST.KSDS))

Share Options determine dataset accessibility.

Example: SHAREOPTIONS(2 3)

Controls: Cross-region sharing, cross-system sharing.

Benefits: Multi-user access.

After an abnormal shutdown, catalog information may not match the actual dataset.

VERIFY: Corrects catalog inconsistencies and makes the dataset available again.

Example:

VERIFY FILE(CUST.KSDS)

CommandPurpose
DEFINECreate VSAM dataset
DELETEDelete dataset
LISTCATDisplay information
REPROCopy records
VERIFYSynchronize catalog
EXPORTBackup VSAM
IMPORTRestore VSAM
ALTERModify attributes

Example:

DELETE CUST.KSDS CLUSTER