VSAM esds

VSAM ESDS

In VSAM, ESDS Stands for ‘Entry Sequenced Data Set’.

Create ESDS Cluster

Example to define a ESDS Cluster

VSAM ESDS

To create ESDS cluster in VSAM, you can use the utility ‘IDCAMS’ where you need to define the cluster name, Data component of the cluster and details of the cluster like FREESPACE, RECSZ, TRACS, CISZ, VOLUMES etc.

Output

ESDS Cluster created - Only Data component is present for ESDS cluster

You can go to ‘Data Set List Utility’ to see that the cluster is created. As you can see this in the above picture

How to load records to the ESDS cluster

If you want to load the records to the cluster, you can use ‘REPRO’ command for that.

Example to load the records to the cluster

Input file to copy records to the ESDS cluster

You can load the records to an ESDS VSAM file using REPRO command. Suppose you have a PS file whose content is as shown above.

The input file is MATEKS.TEST.PSFILE and the ESDS cluster will have records copied from this file by using the command REPRO.

Output file created

You can see that the output VSAM ESDS file is ‘MATEKS.ESDS.CLUSTER1’ whose content is copied from ‘MATEKS.TEST.PSFILE’

How to delete VSAM ESDS Cluster

If you want to delete VSAM cluster, then you can use the ‘DELETE’ functionality of IDCAMS

Syntax 1:
DELETE (‘CLUSTER-NAME’) CLUSTER

Syntax 2:
DELETE (‘CLUSTER-NAME’) CLUSTER
SET MAXCC=0

Example to delete VSAM cluster

Output cluster deleted

If you try to list this cluster, it will not be present as it is deleted.

How to delete VSAM cluster and set MAXCC as 0 every time

VSAM ESDS - Delete cluster and set maxx-0

In this case, we are forcing to set MAXCC as 0.

Output cluster will be deleted and MAXCC will be 0

VSAM Interview Question and Answers

1. In ESDS, the index is refered by

a. 4 byte RRN
b. 2 byte RBA
c. 4 byte RBA
d. 2 byte RRN

c. 4 byte RBA

2. For a ESDS the from and to ranges of records can be specified using the parameter

a. FROMKEY,TOKEY- FOR KSDS
b. FROMADDRESS,TOADDRESS
c. FROMRBA,TORBA
d. FROMNUM,TONUM

b. FROMADDRESS,TOADDRESS

3. A cluster cannot be REUSED if

a. cluster contains KEYRANGES parameter
b. ALTERNATE INDEX built for it
c. Cluster is ESDS
d. Cluster is KSDS

a. cluster contains KEYRANGES parameter

4. An employee master file has to be designed for an organization. Customer says that 96% of the records of the master file will be accessed in one single cycle of processing through a COBOL program. Which of the following file organization you will recommend for the master file?

a. VSAM KSDS
b. VSAM RRDS
c. VSAM ESDS
d. None of the above

c. VSAM ESDS

5. Stmt 1: For Deleting in KSDS and RRDS the File should be opened in I-O mode in Cobol
Stmt 2: ESDS record can be deleted

a. Stmt 1 is true and 2 is false
b. Stmt 2 is true and 1 is false
c. Stmt 1 and 2 are false
d. Stmt 1 and 2 are true

a. Stmt 1 is true and 2 is false

6. Records can be added to end of ESDS in extend mode.

True / False

7. Records will be appended when we are using ___________

Answer: ESDS

8. EXTEND MODE is only for which kind of dataset?

Answer: ESDS

9. What are the operations can we do in ESDS?

Answer: READ, WRITE, RE-WRITE

10. ESDS CAN BE ACCESSED RANDOMLY BY

Answer: RBA

11. Delete and rewrite can be done ESDS

a. Delete is not possible and rewrite is possible
b. Delete is possible and rewrite is not possible

a. Delete is not possible and rewrite is possible 

Tutorials for all brains!