VSAM Key Sequential Data Set (KSDS):

VSAM ESDS VSAM RRDS

Advertisements


KSDS is very commonly used dataset among all datasets of VSAM.

Each record has one or more key fields and a record can be retrieved (or deleted or inserted) by key value.

KSDS can be accessed sequentially in the inserted order without supplying any key.

KSDS can also provide random access to data by supplying key before READ.

KSDS Records can be of fixed length or variable length.

KSDS datasets have most of similar characteristics as ISAM.

KSDS dataset contains index component and data component.

Data component contains all the records in the logical order based on the key defined.

Index component contains the pointers to the all data records to access data.

In KSDS, Key value is unique sequence of characters.

If any record inserted, then the record will be inserted in any place where the key fits and the records after inserted record will be reorganized to maintain the logical order for easy retrieval.

If any record deleted, then the records after the deleted record will be reorganized to maintain the logical order for easy retrieval.

If any record updated, there will be no change in positions.

IMS also uses KDSDs.


Syntax:

KSDS- JCL for creating KSDS dataset:

						
//JOB CARD
//*------------------------------------------------------------------
//* Definition of KSDS
//*------------------------------------------------------------------
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
    DEFINE CLUSTER 				-
       (NAME(userid.CLUSTER.NAME) 		–
	CYLS(4 1)  				-
       	VOL(XXXXXX) 				–
	BUFFERSPACE(20) 			–
	CONTROLINTERVALSIZE(4096) 		–
	FREESPACE(10 20) 			–
	KEYS(10 2) 				–
	RECORDSIZE(75 50) 			–
	SHAREOPTIONS(1 3) 			-
	TO(2050360) 				-
        INDEXED 				-
        NOREUSE 				-
        OWNER(userid) ) 			-
      DATA 					-
        (NAME(userid.CLUSTER.NAME.DATA)) 	-
      INDEX 					-
        (NAME(userid.CLUSTER.NAME.INDEX))	-
      CATALOG(XXXXXX)

/*


VSAM ESDS VSAM RRDS

Advertisements